From: Sasha Levin Date: Wed, 4 May 2016 14:18:15 +0000 (-0400) Subject: Yama: use atomic allocations when reporting X-Git-Tag: v4.7-rc1~124^2~3 X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=commitdiff_plain;h=74f430cd0fdee1bdfb25708ee1e52fc860535a89;p=linux.git 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 --- 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",