Skip to content

Commit 8ffc7db

Browse files
committed
Merge tag 'selinux-pr-20241112' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux
Pull selinux updates from Paul Moore: - Add support for netlink xperms Some time ago we added the concept of "xperms" to the SELinux policy so that we could write policy for individual ioctls, this builds upon this by using extending xperms to netlink so that we can write SELinux policy for individual netlnk message types and not rely on the fairly coarse read/write mapping tables we currently have. There are limitations involving generic netlink due to the multiplexing that is done, but it's no worse that what we currently have. As usual, more information can be found in the commit message. - Deprecate /sys/fs/selinux/user We removed the only known userspace use of this back in 2020 and now that several years have elapsed we're starting down the path of deprecating it in the kernel. - Cleanup the build under scripts/selinux A couple of patches to move the genheaders tool under security/selinux and correct our usage of kernel headers in the tools located under scripts/selinux. While these changes originated out of an effort to build Linux on different systems, they are arguably the right thing to do regardless. - Minor code cleanups and style fixes Not much to say here, two minor cleanup patches that came out of the netlink xperms work * tag 'selinux-pr-20241112' of git://git.kernel.org/pub/scm/linux/kernel/git/pcmoore/selinux: selinux: Deprecate /sys/fs/selinux/user selinux: apply clang format to security/selinux/nlmsgtab.c selinux: streamline selinux_nlmsg_lookup() selinux: Add netlink xperm support selinux: move genheaders to security/selinux/ selinux: do not include <linux/*.h> headers from host programs
2 parents a8220b0 + d7b6918 commit 8ffc7db

File tree

20 files changed

+294
-213
lines changed

20 files changed

+294
-213
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
What: /sys/fs/selinux/user
2+
Date: April 2005 (predates git)
3+
KernelVersion: 2.6.12-rc2 (predates git)
4+
Contact: selinux@vger.kernel.org
5+
Description:
6+
7+
The selinuxfs "user" node allows userspace to request a list
8+
of security contexts that can be reached for a given SELinux
9+
user from a given starting context. This was used by libselinux
10+
when various login-style programs requested contexts for
11+
users, but libselinux stopped using it in 2020.
12+
Kernel support will be removed no sooner than Dec 2025.

scripts/remove-stale-files

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ set -e
2020
# yard. Stale files stay in this file for a while (for some release cycles?),
2121
# then will be really dead and removed from the code base entirely.
2222

23+
# moved to security/selinux/genheaders
24+
rm -f scripts/selinux/genheaders/genheaders
25+
2326
rm -f *.spec
2427

2528
rm -f lib/test_fortify.log

scripts/selinux/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# SPDX-License-Identifier: GPL-2.0-only
2-
subdir-y := mdp genheaders
2+
subdir-y := mdp

scripts/selinux/genheaders/.gitignore

Lines changed: 0 additions & 2 deletions
This file was deleted.

scripts/selinux/genheaders/Makefile

Lines changed: 0 additions & 5 deletions
This file was deleted.

scripts/selinux/mdp/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
hostprogs-always-y += mdp
33
HOST_EXTRACFLAGS += \
4-
-I$(srctree)/include/uapi -I$(srctree)/include \
4+
-I$(srctree)/include \
55
-I$(srctree)/security/selinux/include -I$(objtree)/include
66

77
clean-files := policy.* file_contexts

scripts/selinux/mdp/mdp.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111
* Authors: Serge E. Hallyn <serue@us.ibm.com>
1212
*/
1313

14-
15-
/* NOTE: we really do want to use the kernel headers here */
16-
#define __EXPORTED_HEADERS__
17-
1814
#include <stdio.h>
1915
#include <stdlib.h>
2016
#include <unistd.h>

security/selinux/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
# SPDX-License-Identifier: GPL-2.0-only
22
av_permissions.h
33
flask.h
4+
/genheaders

security/selinux/Makefile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,10 @@ quiet_cmd_genhdrs = GEN $(addprefix $(obj)/,$(genhdrs))
3636
# see the note above, replace the $targets and 'flask.h' rule with the lines
3737
# below:
3838
# targets += $(genhdrs)
39-
# $(addprefix $(obj)/,$(genhdrs)) &: scripts/selinux/...
39+
# $(addprefix $(obj)/,$(genhdrs)) &: $(obj)/genheaders FORCE
4040
targets += flask.h
41-
$(obj)/flask.h: scripts/selinux/genheaders/genheaders FORCE
41+
$(obj)/flask.h: $(obj)/genheaders FORCE
4242
$(call if_changed,genhdrs)
43+
44+
hostprogs := genheaders
45+
HOST_EXTRACFLAGS += -I$(srctree)/security/selinux/include

scripts/selinux/genheaders/genheaders.c renamed to security/selinux/genheaders.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
// SPDX-License-Identifier: GPL-2.0
22

3-
/* NOTE: we really do want to use the kernel headers here */
4-
#define __EXPORTED_HEADERS__
5-
63
#include <stdio.h>
74
#include <stdlib.h>
85
#include <unistd.h>

0 commit comments

Comments
 (0)