Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Sasha Levin and committed by
Kees Cook
74f430cd 470bf1f2

+2 -2
+2 -2
security/yama/yama_lsm.c
··· 47 47 { 48 48 char *target_cmd, *agent_cmd; 49 49 50 - target_cmd = kstrdup_quotable_cmdline(target, GFP_KERNEL); 51 - agent_cmd = kstrdup_quotable_cmdline(agent, GFP_KERNEL); 50 + target_cmd = kstrdup_quotable_cmdline(target, GFP_ATOMIC); 51 + agent_cmd = kstrdup_quotable_cmdline(agent, GFP_ATOMIC); 52 52 53 53 pr_notice_ratelimited( 54 54 "ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",