Skip to content

Commit 74f430c

Browse files
sashalevinkees
authored andcommitted
Yama: use atomic allocations when reporting
Access reporting often happens from atomic contexes. Avoid lockups when allocating memory for command lines. Fixes: 8a56038 ("Yama: consolidate error reporting") Signed-off-by: Sasha Levin <sasha.levin@oracle.com>
1 parent 470bf1f commit 74f430c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

security/yama/yama_lsm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ static void report_access(const char *access, struct task_struct *target,
4747
{
4848
char *target_cmd, *agent_cmd;
4949

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);
5252

5353
pr_notice_ratelimited(
5454
"ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",

0 commit comments

Comments
 (0)