ibpkey.h 689 B

12345678910111213141516171819202122232425262728293031323334
  1. /* SPDX-License-Identifier: GPL-2.0-only */
  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.
  8. */
  9. /*
  10. * (c) Mellanox Technologies, 2016
  11. */
  12. #ifndef _SELINUX_IB_PKEY_H
  13. #define _SELINUX_IB_PKEY_H
  14. #include <linux/types.h>
  15. #ifdef CONFIG_SECURITY_INFINIBAND
  16. void sel_ib_pkey_flush(void);
  17. int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
  18. #else
  19. static inline void sel_ib_pkey_flush(void)
  20. {
  21. return;
  22. }
  23. static inline int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid)
  24. {
  25. *sid = SECINITSID_UNLABELED;
  26. return 0;
  27. }
  28. #endif
  29. #endif