summaryrefslogtreecommitdiff
path: root/security/yama/yama_lsm.c
diff options
context:
space:
mode:
authorSasha Levin <sasha.levin@oracle.com>2016-05-04 17:18:15 +0300
committerKees Cook <keescook@chromium.org>2016-05-04 20:54:05 +0300
commit74f430cd0fdee1bdfb25708ee1e52fc860535a89 (patch)
tree680fa0263011749210469b5aa4f20f98a2aa6644 /security/yama/yama_lsm.c
parent470bf1f27a1472264d18c84b324389509f0e30b3 (diff)
downloadlinux-74f430cd0fdee1bdfb25708ee1e52fc860535a89.tar.xz
Yama: use atomic allocations when reporting
Access reporting often happens from atomic contexes. Avoid lockups when allocating memory for command lines. Fixes: 8a56038c2ae ("Yama: consolidate error reporting") Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
Diffstat (limited to 'security/yama/yama_lsm.c')
-rw-r--r--security/yama/yama_lsm.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/security/yama/yama_lsm.c b/security/yama/yama_lsm.c
index c19f6e5df9a3..9b756b1f3dc5 100644
--- a/security/yama/yama_lsm.c
+++ b/security/yama/yama_lsm.c
@@ -47,8 +47,8 @@ static void report_access(const char *access, struct task_struct *target,
{
char *target_cmd, *agent_cmd;
- target_cmd = kstrdup_quotable_cmdline(target, GFP_KERNEL);
- agent_cmd = kstrdup_quotable_cmdline(agent, GFP_KERNEL);
+ target_cmd = kstrdup_quotable_cmdline(target, GFP_ATOMIC);
+ agent_cmd = kstrdup_quotable_cmdline(agent, GFP_ATOMIC);
pr_notice_ratelimited(
"ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",