1 /* SPDX-License-Identifier: GPL-2.0 */ 1 2 /* 3 * SELinux support for the XFRM LSM hooks 4 * 5 * Author : Trent Jaeger, <jaegert@us.ibm.com> 6 * Updated : Venkat Yekkirala, <vyekkirala@Tru 7 */ 8 9 #ifndef _SELINUX_XFRM_H_ 10 #define _SELINUX_XFRM_H_ 11 12 #include <linux/lsm_audit.h> 13 #include <net/flow.h> 14 #include <net/xfrm.h> 15 16 int selinux_xfrm_policy_alloc(struct xfrm_sec_ 17 struct xfrm_user 18 int selinux_xfrm_policy_clone(struct xfrm_sec_ 19 struct xfrm_sec_ 20 void selinux_xfrm_policy_free(struct xfrm_sec_ 21 int selinux_xfrm_policy_delete(struct xfrm_sec 22 int selinux_xfrm_state_alloc(struct xfrm_state 23 struct xfrm_user_ 24 int selinux_xfrm_state_alloc_acquire(struct xf 25 struct xf 26 void selinux_xfrm_state_free(struct xfrm_state 27 int selinux_xfrm_state_delete(struct xfrm_stat 28 int selinux_xfrm_policy_lookup(struct xfrm_sec 29 int selinux_xfrm_state_pol_flow_match(struct x 30 struct x 31 const st 32 33 #ifdef CONFIG_SECURITY_NETWORK_XFRM 34 extern atomic_t selinux_xfrm_refcount; 35 36 static inline int selinux_xfrm_enabled(void) 37 { 38 return (atomic_read(&selinux_xfrm_refc 39 } 40 41 int selinux_xfrm_sock_rcv_skb(u32 sk_sid, stru 42 struct common_au 43 int selinux_xfrm_postroute_last(u32 sk_sid, st 44 struct common_ 45 int selinux_xfrm_decode_session(struct sk_buff 46 int selinux_xfrm_skb_sid(struct sk_buff *skb, 47 48 static inline void selinux_xfrm_notify_policyl 49 { 50 struct net *net; 51 52 down_read(&net_rwsem); 53 for_each_net(net) 54 rt_genid_bump_all(net); 55 up_read(&net_rwsem); 56 } 57 #else 58 static inline int selinux_xfrm_enabled(void) 59 { 60 return 0; 61 } 62 63 static inline int selinux_xfrm_sock_rcv_skb(u3 64 st 65 { 66 return 0; 67 } 68 69 static inline int selinux_xfrm_postroute_last( 70 71 72 { 73 return 0; 74 } 75 76 static inline int selinux_xfrm_decode_session( 77 78 { 79 *sid = SECSID_NULL; 80 return 0; 81 } 82 83 static inline void selinux_xfrm_notify_policyl 84 { 85 } 86 87 static inline int selinux_xfrm_skb_sid(struct 88 { 89 *sid = SECSID_NULL; 90 return 0; 91 } 92 #endif 93 94 #endif /* _SELINUX_XFRM_H_ */ 95
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.