David Brazdil | 0f672f6 | 2019-12-10 10:32:29 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 2 | /* |
| 3 | * pkey table |
| 4 | * |
| 5 | * SELinux must keep a mapping of pkeys to labels/SIDs. This |
| 6 | * mapping is maintained as part of the normal policy but a fast cache is |
| 7 | * needed to reduce the lookup overhead. |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 8 | */ |
| 9 | |
| 10 | /* |
| 11 | * (c) Mellanox Technologies, 2016 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 12 | */ |
| 13 | |
| 14 | #ifndef _SELINUX_IB_PKEY_H |
| 15 | #define _SELINUX_IB_PKEY_H |
| 16 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 17 | #ifdef CONFIG_SECURITY_INFINIBAND |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 18 | void sel_ib_pkey_flush(void); |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 19 | int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid); |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 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 |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 31 | |
| 32 | #endif |