Skip to content

Commit 6f594f5

Browse files
cgzonespcmoore
authored andcommitted
selinux: improve debug configuration
If the SELinux debug configuration is enabled define the macro DEBUG such that pr_debug() calls are always enabled, regardless of CONFIG_DYNAMIC_DEBUG, since those message are the main reason for this configuration in the first place. Mention example usage in case CONFIG_DYNAMIC_DEBUG is enabled in the help section of the configuration. Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Reviewed-by: Stephen Smalley <stephen.smalley.work@gmail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
1 parent fb8142f commit 6f594f5

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

security/selinux/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,13 @@ config SECURITY_SELINUX_DEBUG
7777
This enables debugging code designed to help SELinux kernel
7878
developers, unless you know what this does in the kernel code you
7979
should leave this disabled.
80+
81+
To fine control the messages to be printed enable
82+
CONFIG_DYNAMIC_DEBUG and see
83+
Documentation/admin-guide/dynamic-debug-howto.rst for additional
84+
information.
85+
86+
Example usage:
87+
88+
echo -n 'file "security/selinux/*" +p' > \
89+
/proc/dynamic_debug/control

security/selinux/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ obj-$(CONFIG_SECURITY_SELINUX) := selinux.o
1212

1313
ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
1414

15+
ccflags-$(CONFIG_SECURITY_SELINUX_DEBUG) += -DDEBUG
16+
1517
selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o \
1618
netnode.o netport.o status.o \
1719
ss/ebitmap.o ss/hashtab.o ss/symtab.o ss/sidtab.o ss/avtab.o \

0 commit comments

Comments
 (0)