blob: c992f83b0aae00ec467acb2cd87d42b195ab7435 [file] [log] [blame]
Thomas Gleixner5b497af2019-05-29 07:18:09 -07001/* SPDX-License-Identifier: GPL-2.0-only */
Daniel Jurgens409dcf32017-05-19 15:48:59 +03002/*
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.
Daniel Jurgens409dcf32017-05-19 15:48:59 +03008 */
9
10/*
11 * (c) Mellanox Technologies, 2016
Daniel Jurgens409dcf32017-05-19 15:48:59 +030012 */
13
14#ifndef _SELINUX_IB_PKEY_H
15#define _SELINUX_IB_PKEY_H
16
Christian Göttsche4ad37de2022-05-02 16:15:20 +020017#include <linux/types.h>
18
Ravi Kumar Siddojigarife49c7e2020-01-09 16:40:47 +053019#ifdef CONFIG_SECURITY_INFINIBAND
Daniel Jurgens409dcf32017-05-19 15:48:59 +030020void sel_ib_pkey_flush(void);
Daniel Jurgens409dcf32017-05-19 15:48:59 +030021int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
Ravi Kumar Siddojigarife49c7e2020-01-09 16:40:47 +053022#else
23static inline void sel_ib_pkey_flush(void)
24{
25 return;
26}
27static inline int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid)
28{
29 *sid = SECINITSID_UNLABELED;
30 return 0;
31}
32#endif
Daniel Jurgens409dcf32017-05-19 15:48:59 +030033
34#endif