···3636 select CRYPTO3737 select CRYPTO_SHA13838 default y3939-4039 help4140 This option selects whether introspection of loaded policy4241 is available to userspace via the apparmor filesystem.···4445 bool "Enable policy hash introspection by default"4546 depends on SECURITY_APPARMOR_HASH4647 default y4747-4848 help4949 This option selects whether sha1 hashing of loaded policy5050 is enabled by default. The generation of sha1 hashes for···5254 however it can slow down policy load on some devices. In5355 these cases policy hashing can be disabled by default and5456 enabled only if needed.5757+5858+config SECURITY_APPARMOR_DEBUG5959+ bool "Build AppArmor with debug code"6060+ depends on SECURITY_APPARMOR6161+ default n6262+ help6363+ Build apparmor with debugging logic in apparmor. Not all6464+ debugging logic will necessarily be enabled. A submenu will6565+ provide fine grained control of the debug options that are6666+ available.6767+6868+config SECURITY_APPARMOR_DEBUG_ASSERTS6969+ bool "Build AppArmor with debugging asserts"7070+ depends on SECURITY_APPARMOR_DEBUG7171+ default y7272+ help7373+ Enable code assertions made with AA_BUG. These are primarily7474+ function entry preconditions but also exist at other key7575+ points. If the assert is triggered it will trigger a WARN7676+ message.7777+7878+config SECURITY_APPARMOR_DEBUG_MESSAGES7979+ bool "Debug messages enabled by default"8080+ depends on SECURITY_APPARMOR_DEBUG8181+ default n8282+ help8383+ Set the default value of the apparmor.debug kernel parameter.8484+ When enabled, various debug messages will be logged to8585+ the kernel message buffer.
+13-1
security/apparmor/include/lib.h
···3535 * which is not related to profile accesses.3636 */37373838+#define DEBUG_ON (aa_g_debug)3939+#define dbg_printk(__fmt, __args...) pr_debug(__fmt, ##__args)3840#define AA_DEBUG(fmt, args...) \3941 do { \4040- if (aa_g_debug) \4242+ if (DEBUG_ON) \4143 pr_debug_ratelimited("AppArmor: " fmt, ##args); \4244 } while (0)4545+4646+#define AA_WARN(X) WARN((X), "APPARMOR WARN %s: %s\n", __func__, #X)4747+4848+#define AA_BUG(X, args...) AA_BUG_FMT((X), "" args)4949+#ifdef CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS5050+#define AA_BUG_FMT(X, fmt, args...) \5151+ WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)5252+#else5353+#define AA_BUG_FMT(X, fmt, args...)5454+#endif43554456#define AA_ERROR(fmt, args...) \4557 pr_err_ratelimited("AppArmor: " fmt, ##args)