浏览代码

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>
Sasha Levin 9 年之前
父节点
当前提交
74f430cd0f
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      security/yama/yama_lsm.c

+ 2 - 2
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;
 	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(
 	pr_notice_ratelimited(
 		"ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",
 		"ptrace %s of \"%s\"[%d] was attempted by \"%s\"[%d]\n",