ibpkey.h 663 B

1234567891011121314151617181920212223242526272829303132
  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. #ifdef CONFIG_SECURITY_INFINIBAND
  15. void sel_ib_pkey_flush(void);
  16. int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
  17. #else
  18. static inline void sel_ib_pkey_flush(void)
  19. {
  20. return;
  21. }
  22. static inline int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid)
  23. {
  24. *sid = SECINITSID_UNLABELED;
  25. return 0;
  26. }
  27. #endif
  28. #endif