Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
680cd62e
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
提交
680cd62e
编写于
1月 16, 2017
作者:
J
John Johansen
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
apparmor: add debug assert AA_BUG and Kconfig to control debug info
Signed-off-by:
N
John Johansen
<
john.johansen@canonical.com
>
上级
57e36bbd
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
43 addition
and
4 deletion
+43
-4
security/apparmor/Kconfig
security/apparmor/Kconfig
+29
-2
security/apparmor/include/lib.h
security/apparmor/include/lib.h
+13
-1
security/apparmor/lsm.c
security/apparmor/lsm.c
+1
-1
未找到文件。
security/apparmor/Kconfig
浏览文件 @
680cd62e
...
@@ -36,7 +36,6 @@ config SECURITY_APPARMOR_HASH
...
@@ -36,7 +36,6 @@ config SECURITY_APPARMOR_HASH
select CRYPTO
select CRYPTO
select CRYPTO_SHA1
select CRYPTO_SHA1
default y
default y
help
help
This option selects whether introspection of loaded policy
This option selects whether introspection of loaded policy
is available to userspace via the apparmor filesystem.
is available to userspace via the apparmor filesystem.
...
@@ -45,7 +44,6 @@ config SECURITY_APPARMOR_HASH_DEFAULT
...
@@ -45,7 +44,6 @@ config SECURITY_APPARMOR_HASH_DEFAULT
bool "Enable policy hash introspection by default"
bool "Enable policy hash introspection by default"
depends on SECURITY_APPARMOR_HASH
depends on SECURITY_APPARMOR_HASH
default y
default y
help
help
This option selects whether sha1 hashing of loaded policy
This option selects whether sha1 hashing of loaded policy
is enabled by default. The generation of sha1 hashes for
is enabled by default. The generation of sha1 hashes for
...
@@ -54,3 +52,32 @@ config SECURITY_APPARMOR_HASH_DEFAULT
...
@@ -54,3 +52,32 @@ config SECURITY_APPARMOR_HASH_DEFAULT
however it can slow down policy load on some devices. In
however it can slow down policy load on some devices. In
these cases policy hashing can be disabled by default and
these cases policy hashing can be disabled by default and
enabled only if needed.
enabled only if needed.
config SECURITY_APPARMOR_DEBUG
bool "Build AppArmor with debug code"
depends on SECURITY_APPARMOR
default n
help
Build apparmor with debugging logic in apparmor. Not all
debugging logic will necessarily be enabled. A submenu will
provide fine grained control of the debug options that are
available.
config SECURITY_APPARMOR_DEBUG_ASSERTS
bool "Build AppArmor with debugging asserts"
depends on SECURITY_APPARMOR_DEBUG
default y
help
Enable code assertions made with AA_BUG. These are primarily
function entry preconditions but also exist at other key
points. If the assert is triggered it will trigger a WARN
message.
config SECURITY_APPARMOR_DEBUG_MESSAGES
bool "Debug messages enabled by default"
depends on SECURITY_APPARMOR_DEBUG
default n
help
Set the default value of the apparmor.debug kernel parameter.
When enabled, various debug messages will be logged to
the kernel message buffer.
security/apparmor/include/lib.h
浏览文件 @
680cd62e
...
@@ -35,12 +35,24 @@
...
@@ -35,12 +35,24 @@
* which is not related to profile accesses.
* which is not related to profile accesses.
*/
*/
#define DEBUG_ON (aa_g_debug)
#define dbg_printk(__fmt, __args...) pr_debug(__fmt, ##__args)
#define AA_DEBUG(fmt, args...) \
#define AA_DEBUG(fmt, args...) \
do { \
do { \
if (
aa_g_debug
) \
if (
DEBUG_ON
) \
pr_debug_ratelimited("AppArmor: " fmt, ##args); \
pr_debug_ratelimited("AppArmor: " fmt, ##args); \
} while (0)
} while (0)
#define AA_WARN(X) WARN((X), "APPARMOR WARN %s: %s\n", __func__, #X)
#define AA_BUG(X, args...) AA_BUG_FMT((X), "" args)
#ifdef CONFIG_SECURITY_APPARMOR_DEBUG_ASSERTS
#define AA_BUG_FMT(X, fmt, args...) \
WARN((X), "AppArmor WARN %s: (" #X "): " fmt, __func__, ##args)
#else
#define AA_BUG_FMT(X, fmt, args...)
#endif
#define AA_ERROR(fmt, args...) \
#define AA_ERROR(fmt, args...) \
pr_err_ratelimited("AppArmor: " fmt, ##args)
pr_err_ratelimited("AppArmor: " fmt, ##args)
...
...
security/apparmor/lsm.c
浏览文件 @
680cd62e
...
@@ -681,7 +681,7 @@ module_param_named(hash_policy, aa_g_hash_policy, aabool, S_IRUSR | S_IWUSR);
...
@@ -681,7 +681,7 @@ module_param_named(hash_policy, aa_g_hash_policy, aabool, S_IRUSR | S_IWUSR);
#endif
#endif
/* Debug mode */
/* Debug mode */
bool
aa_g_debug
;
bool
aa_g_debug
=
IS_ENABLED
(
CONFIG_SECURITY_DEBUG_MESSAGES
)
;
module_param_named
(
debug
,
aa_g_debug
,
aabool
,
S_IRUSR
|
S_IWUSR
);
module_param_named
(
debug
,
aa_g_debug
,
aabool
,
S_IRUSR
|
S_IWUSR
);
/* Audit mode */
/* Audit mode */
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录