Skip to content

Patches to enable chroot for all users

Tal Tchwella lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest3 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3enabled chroot for all usersfs/exec.c fs/open.c include/linux/sched.h +2 more+24 -20 replies
2/3socket checks for uds fds transfernet/core/scm.c+9 -00 replies
3/3open fds check when starting chrootfs/open.c+24 -00 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/3] Patches to enable chroot for all users

I want to suggest adding chroot capability to all users.
The following patches enable that capability, while considering the security mechanism needed to disable escape routes for chroots by non-root users, and keeping chroot backward-compatible for root users.
The first patch establishes the concept of multi-user chroot, while disabling checks for root user in the chroot process.
The second patch checks whether a fd that is sent to a chroot application by a non-root user refers to a directory.
If that is the case, that fd is skipped, to disable an escape route.
The third patch disables the option for applications that have open fds to directories to be chrooted by a non-root user.

Any comments, feedback and suggestions are appreciated!

Thanks,
Tal

Tal Tchwella (3):
enabled chroot for all users
socket checks for uds fds transfer
open fds check when starting chroot

 fs/exec.c             |    3 +++
 fs/open.c             |   32 ++++++++++++++++++++++++++++++--
 include/linux/sched.h |   12 ++++++++++++
 init/main.c           |    1 +
 kernel/fork.c         |    2 ++
 net/core/scm.c        |    9 +++++++++
 6 files changed, 57 insertions(+), 2 deletions(-)
Signature · 1 line
1.7.9.5