Skip to content

Fixing ptrace vs exec vs userns interactions

Eric W. Biederman containers linux-fsdevel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 39 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3ptrace: Capture the ptracer's creds not PT_PTRACE_CAPfs/exec.c include/linux/capability.h include/linux/ptrace.h +3 more+30 -78 replies
2/3exec: Don't allow ptracing an exec of an unreadable filefs/exec.c+7 -118 replies
2/3ptrace: Don't allow accessing an undumpable mmarch/alpha/kernel/ptrace.c arch/blackfin/kernel/ptrace.c arch/cris/arch-v32/kernel/ptrace.c +8 more+51 -172 replies
3/3exec: Ensure mm->user_ns contains the execed filesfs/exec.c include/linux/capability.h kernel/capability.c+30 -30 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [REVIEW][PATCH 0/3] Fixing ptrace vs exec vs userns interactions

With everyone heading to Kernel Summit and Plumbers I put this set of
patches down temporarily. Now is the time to take it back up and to
make certain I am not missing something stupid in this set of patches.

There are other issues in this area as well, but these are the pieces that I can see clearly, and have tested fixes for.

Andy as to your criticism about using strace sudo I can't possibly see how that is effective or useful. Under strace sudo won't run as root today, and will immediately exit because it is not root. Furthermore the only place I can find non-readable executables is people hardening suid root executables so they are more difficult to trace. So I definitely think we should honor the unix permissions and people's expressed wishes.

Eric W. Biederman (3):
ptrace: Capture the ptracer's creds not PT_PTRACE_CAP
exec: Don't allow ptracing an exec of an unreadable file
exec: Ensure mm->user_ns contains the execed files

 fs/exec.c                  | 26 +++++++++++++++++++++++---
 include/linux/capability.h |  2 ++
 include/linux/ptrace.h     |  1 -
 include/linux/sched.h      |  1 +
 kernel/capability.c        | 36 ++++++++++++++++++++++++++++++++++--
 kernel/ptrace.c            | 12 +++++++-----
 6 files changed, 67 insertions(+), 11 deletions(-)

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>