Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0-only */
0002 /*
0003  * pkey table
0004  *
0005  * SELinux must keep a mapping of pkeys to labels/SIDs.  This
0006  * mapping is maintained as part of the normal policy but a fast cache is
0007  * needed to reduce the lookup overhead.
0008  */
0009 
0010 /*
0011  * (c) Mellanox Technologies, 2016
0012  */
0013 
0014 #ifndef _SELINUX_IB_PKEY_H
0015 #define _SELINUX_IB_PKEY_H
0016 
0017 #include <linux/types.h>
0018 
0019 #ifdef CONFIG_SECURITY_INFINIBAND
0020 void sel_ib_pkey_flush(void);
0021 int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
0022 #else
0023 static inline void sel_ib_pkey_flush(void)
0024 {
0025     return;
0026 }
0027 static inline int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid)
0028 {
0029     *sid = SECINITSID_UNLABELED;
0030     return 0;
0031 }
0032 #endif
0033 
0034 #endif