hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/security/selinux/include/ibpkey.h
....@@ -1,31 +1,32 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * pkey table
34 *
45 * SELinux must keep a mapping of pkeys to labels/SIDs. This
56 * mapping is maintained as part of the normal policy but a fast cache is
67 * needed to reduce the lookup overhead.
7
- *
88 */
99
1010 /*
1111 * (c) Mellanox Technologies, 2016
12
- *
13
- * This program is free software: you can redistribute it and/or modify
14
- * it under the terms of version 2 of the GNU General Public License as
15
- * published by the Free Software Foundation.
16
- *
17
- * This program is distributed in the hope that it will be useful,
18
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
19
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20
- * GNU General Public License for more details.
21
- *
2212 */
2313
2414 #ifndef _SELINUX_IB_PKEY_H
2515 #define _SELINUX_IB_PKEY_H
2616
17
+#ifdef CONFIG_SECURITY_INFINIBAND
2718 void sel_ib_pkey_flush(void);
28
-
2919 int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
20
+#else
21
+static inline void sel_ib_pkey_flush(void)
22
+{
23
+ return;
24
+}
25
+static inline int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid)
26
+{
27
+ *sid = SECINITSID_UNLABELED;
28
+ return 0;
29
+}
30
+#endif
3031
3132 #endif