~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/security/selinux/include/xfrm.h

Version: ~ [ linux-5.4-rc3 ] ~ [ linux-5.3.6 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.79 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.149 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.196 ] ~ [ linux-4.8.17 ] ~ [ linux-4.7.10 ] ~ [ linux-4.6.7 ] ~ [ linux-4.5.7 ] ~ [ linux-4.4.196 ] ~ [ linux-4.3.6 ] ~ [ linux-4.2.8 ] ~ [ linux-4.1.52 ] ~ [ linux-4.0.9 ] ~ [ linux-3.19.8 ] ~ [ linux-3.18.140 ] ~ [ linux-3.17.8 ] ~ [ linux-3.16.75 ] ~ [ linux-3.15.10 ] ~ [ linux-3.14.79 ] ~ [ linux-3.13.11 ] ~ [ linux-3.12.74 ] ~ [ linux-3.11.10 ] ~ [ linux-3.10.108 ] ~ [ linux-3.9.11 ] ~ [ linux-3.8.13 ] ~ [ linux-3.7.10 ] ~ [ linux-3.6.11 ] ~ [ linux-3.5.7 ] ~ [ linux-3.4.113 ] ~ [ linux-3.3.8 ] ~ [ linux-3.2.102 ] ~ [ linux-3.1.10 ] ~ [ linux-3.0.101 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.5 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * SELinux support for the XFRM LSM hooks
  4  *
  5  * Author : Trent Jaeger, <jaegert@us.ibm.com>
  6  * Updated : Venkat Yekkirala, <vyekkirala@TrustedCS.com>
  7  */
  8 #ifndef _SELINUX_XFRM_H_
  9 #define _SELINUX_XFRM_H_
 10 
 11 #include <net/flow.h>
 12 
 13 int selinux_xfrm_policy_alloc(struct xfrm_sec_ctx **ctxp,
 14                               struct xfrm_user_sec_ctx *uctx,
 15                               gfp_t gfp);
 16 int selinux_xfrm_policy_clone(struct xfrm_sec_ctx *old_ctx,
 17                               struct xfrm_sec_ctx **new_ctxp);
 18 void selinux_xfrm_policy_free(struct xfrm_sec_ctx *ctx);
 19 int selinux_xfrm_policy_delete(struct xfrm_sec_ctx *ctx);
 20 int selinux_xfrm_state_alloc(struct xfrm_state *x,
 21                              struct xfrm_user_sec_ctx *uctx);
 22 int selinux_xfrm_state_alloc_acquire(struct xfrm_state *x,
 23                                      struct xfrm_sec_ctx *polsec, u32 secid);
 24 void selinux_xfrm_state_free(struct xfrm_state *x);
 25 int selinux_xfrm_state_delete(struct xfrm_state *x);
 26 int selinux_xfrm_policy_lookup(struct xfrm_sec_ctx *ctx, u32 fl_secid, u8 dir);
 27 int selinux_xfrm_state_pol_flow_match(struct xfrm_state *x,
 28                                       struct xfrm_policy *xp,
 29                                       const struct flowi *fl);
 30 
 31 #ifdef CONFIG_SECURITY_NETWORK_XFRM
 32 extern atomic_t selinux_xfrm_refcount;
 33 
 34 static inline int selinux_xfrm_enabled(void)
 35 {
 36         return (atomic_read(&selinux_xfrm_refcount) > 0);
 37 }
 38 
 39 int selinux_xfrm_sock_rcv_skb(u32 sk_sid, struct sk_buff *skb,
 40                               struct common_audit_data *ad);
 41 int selinux_xfrm_postroute_last(u32 sk_sid, struct sk_buff *skb,
 42                                 struct common_audit_data *ad, u8 proto);
 43 int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid, int ckall);
 44 int selinux_xfrm_skb_sid(struct sk_buff *skb, u32 *sid);
 45 
 46 static inline void selinux_xfrm_notify_policyload(void)
 47 {
 48         struct net *net;
 49 
 50         down_read(&net_rwsem);
 51         for_each_net(net)
 52                 rt_genid_bump_all(net);
 53         up_read(&net_rwsem);
 54 }
 55 #else
 56 static inline int selinux_xfrm_enabled(void)
 57 {
 58         return 0;
 59 }
 60 
 61 static inline int selinux_xfrm_sock_rcv_skb(u32 sk_sid, struct sk_buff *skb,
 62                                             struct common_audit_data *ad)
 63 {
 64         return 0;
 65 }
 66 
 67 static inline int selinux_xfrm_postroute_last(u32 sk_sid, struct sk_buff *skb,
 68                                               struct common_audit_data *ad,
 69                                               u8 proto)
 70 {
 71         return 0;
 72 }
 73 
 74 static inline int selinux_xfrm_decode_session(struct sk_buff *skb, u32 *sid,
 75                                               int ckall)
 76 {
 77         *sid = SECSID_NULL;
 78         return 0;
 79 }
 80 
 81 static inline void selinux_xfrm_notify_policyload(void)
 82 {
 83 }
 84 
 85 static inline int selinux_xfrm_skb_sid(struct sk_buff *skb, u32 *sid)
 86 {
 87         *sid = SECSID_NULL;
 88         return 0;
 89 }
 90 #endif
 91 
 92 #endif /* _SELINUX_XFRM_H_ */
 93 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | Wiki (Japanese) | Wiki (English) | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

osdn.jp