ibpkey.h 708 B

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