提交 d4eb82c7 编写于 作者: C Chris Wright 提交者: Linus Torvalds

[PATCH] make cap_ptrace enforce PTRACE_TRACME checks

PTRACE_TRACEME doesn't have proper capabilities validation when parent is
less privileged than child.  Issue pointed out by Ram Gupta
<ram.gupta5@gmail.com>.

Note: I haven't identified a strong security issue, and it's a small ABI
change that could break apps that rely on existing behaviour (which allows
parent that is less privileged than child to ptrace when child does
PTRACE_TRACEME).
Signed-off-by: NChris Wright <chrisw@sous-sol.org>
Cc: Ram Gupta <ram.gupta5@gmail.com>
Signed-off-by: NAndrew Morton <akpm@osdl.org>
Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
上级 12b5989b
...@@ -60,8 +60,8 @@ int cap_settime(struct timespec *ts, struct timezone *tz) ...@@ -60,8 +60,8 @@ int cap_settime(struct timespec *ts, struct timezone *tz)
int cap_ptrace (struct task_struct *parent, struct task_struct *child) int cap_ptrace (struct task_struct *parent, struct task_struct *child)
{ {
/* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */ /* Derived from arch/i386/kernel/ptrace.c:sys_ptrace. */
if (!cap_issubset (child->cap_permitted, current->cap_permitted) && if (!cap_issubset(child->cap_permitted, parent->cap_permitted) &&
!capable(CAP_SYS_PTRACE)) !__capable(parent, CAP_SYS_PTRACE))
return -EPERM; return -EPERM;
return 0; return 0;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册