Skip to content

Commit

Permalink
Yama: use atomic allocations when reporting
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
sashalevin authored and kees committed May 4, 2016
1 parent 470bf1f commit 74f430c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions security/yama/yama_lsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 74f430c

Please sign in to comment.