From: "Christian Göttsche" <cgzones@googlemail.com>
To: selinux@vger.kernel.org
Cc: Paul Moore <paul@paul-moore.com>,
Stephen Smalley <stephen.smalley.work@gmail.com>,
Eric Paris <eparis@parisplace.org>,
Ondrej Mosnacek <omosnace@redhat.com>,
linux-kernel@vger.kernel.org
Subject: [PATCH 3/6] selinux: improve debug configuration
Date: Fri, 18 Aug 2023 17:12:14 +0200 [thread overview]
Message-ID: <20230818151220.166215-2-cgzones@googlemail.com> (raw)
In-Reply-To: <20230818151220.166215-1-cgzones@googlemail.com>
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>
---
security/selinux/Kconfig | 10 ++++++++++
security/selinux/Makefile | 2 ++
2 files changed, 12 insertions(+)
diff --git a/security/selinux/Kconfig b/security/selinux/Kconfig
index d30348fbe0df..61abc1e094a8 100644
--- a/security/selinux/Kconfig
+++ b/security/selinux/Kconfig
@@ -77,3 +77,13 @@ config SECURITY_SELINUX_DEBUG
This enables debugging code designed to help SELinux kernel
developers, unless you know what this does in the kernel code you
should leave this disabled.
+
+ To fine control the messages to be printed enable
+ CONFIG_DYNAMIC_DEBUG and see
+ Documentation/admin-guide/dynamic-debug-howto.rst for additional
+ information.
+
+ Example usage:
+
+ echo -n 'file "security/selinux/*" +p' > \
+ /proc/dynamic_debug/control
diff --git a/security/selinux/Makefile b/security/selinux/Makefile
index 836379639058..c47519ed8156 100644
--- a/security/selinux/Makefile
+++ b/security/selinux/Makefile
@@ -12,6 +12,8 @@ obj-$(CONFIG_SECURITY_SELINUX) := selinux.o
ccflags-y := -I$(srctree)/security/selinux -I$(srctree)/security/selinux/include
+ccflags-$(CONFIG_SECURITY_SELINUX_DEBUG) += -DDEBUG
+
selinux-y := avc.o hooks.o selinuxfs.o netlink.o nlmsgtab.o netif.o \
netnode.o netport.o status.o \
ss/ebitmap.o ss/hashtab.o ss/symtab.o ss/sidtab.o ss/avtab.o \
--
2.40.1
next prev parent reply other threads:[~2023-08-18 15:13 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-18 15:12 [PATCH 2/6] selinux: dump statistics for more hash tables Christian Göttsche
2023-08-18 15:12 ` Christian Göttsche [this message]
2023-09-08 16:08 ` [PATCH 3/6] selinux: improve debug configuration Stephen Smalley
2023-09-13 17:46 ` Paul Moore
2023-08-18 15:12 ` [PATCH 4/6] selinux: simplify avtab slot calculation Christian Göttsche
2023-09-08 18:44 ` Stephen Smalley
2023-09-13 17:46 ` Paul Moore
2023-08-18 15:12 ` [PATCH 5/6] selinux: improve role transition hashing Christian Göttsche
2023-09-08 18:46 ` Stephen Smalley
2023-09-13 17:46 ` Paul Moore
2023-08-18 15:12 ` [PATCH 6/6] selinux: improve symtab string hashing Christian Göttsche
2023-09-07 17:44 ` Stephen Smalley
2023-09-13 17:46 ` Paul Moore
2023-09-08 18:49 ` Stephen Smalley
2023-08-18 15:12 ` [PATCH 1/6] selinux: print sum of chain lengths^2 for hash tables Christian Göttsche
2023-09-08 18:47 ` Stephen Smalley
2023-09-13 17:46 ` Paul Moore
2023-09-07 17:42 ` [PATCH 2/6] selinux: dump statistics for more " Stephen Smalley
2023-09-13 16:11 ` Paul Moore
2023-09-13 18:03 ` Stephen Smalley
2023-09-13 18:07 ` Paul Moore
2023-09-08 18:03 ` Stephen Smalley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230818151220.166215-2-cgzones@googlemail.com \
--to=cgzones@googlemail.com \
--cc=eparis@parisplace.org \
--cc=linux-kernel@vger.kernel.org \
--cc=omosnace@redhat.com \
--cc=paul@paul-moore.com \
--cc=selinux@vger.kernel.org \
--cc=stephen.smalley.work@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®