Skip to content

Commit fe49c7e

Browse files
Ravi Kumar Siddojigaripcmoore
authored andcommitted
selinux: move ibpkeys code under CONFIG_SECURITY_INFINIBAND.
Move cache based pkey sid retrieval code which was added with commit "409dcf31" under CONFIG_SECURITY_INFINIBAND. As its going to alloc a new cache which impacts low RAM devices which was enabled by default. Suggested-by: Paul Moore <paul@paul-moore.com> Signed-off-by: Ravi Kumar Siddojigari <rsiddoji@codeaurora.org> [PM: checkpatch.pl cleanups, fixed capitalization in the description] Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent b82f3f6 commit fe49c7e

2 files changed

Lines changed: 15 additions & 2 deletions

File tree

‎security/selinux/Makefile‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,16 @@
66
obj-$(CONFIG_SECURITY_SELINUX) := selinux.o
77

88
selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o \
9-
netnode.o netport.o ibpkey.o \
9+
netnode.o netport.o \
1010
ss/ebitmap.o ss/hashtab.o ss/symtab.o ss/sidtab.o ss/avtab.o \
1111
ss/policydb.o ss/services.o ss/conditional.o ss/mls.o ss/status.o
1212

1313
selinux-$(CONFIG_SECURITY_NETWORK_XFRM) += xfrm.o
1414

1515
selinux-$(CONFIG_NETLABEL) += netlabel.o
1616

17+
selinux-$(CONFIG_SECURITY_INFINIBAND) += ibpkey.o
18+
1719
ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
1820

1921
$(addprefix $(obj)/,$(selinux-y)): $(obj)/flask.h

‎security/selinux/include/ibpkey.h‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,19 @@
1414
#ifndef _SELINUX_IB_PKEY_H
1515
#define _SELINUX_IB_PKEY_H
1616

17+
#ifdef CONFIG_SECURITY_INFINIBAND
1718
void sel_ib_pkey_flush(void);
18-
1919
int sel_ib_pkey_sid(u64 subnet_prefix, u16 pkey, u32 *sid);
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
2031

2132
#endif

0 commit comments

Comments
 (0)