[Bug 121073] [kernel] [patch] run chroot as an unprivileged user

bz-noreply at freebsd.org bz-noreply at freebsd.org
Sun Jun 8 23:36:45 UTC 2014


https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=121073

--- Comment #7 from Jille at quis.cx ---
I remember someone saying this could be exploited using rfork. I don't know why
it's not listed in this bug.

IIRC the problem was that fd_rdir (root of the processes) was stored in
proc->p_fd (struct filedesc) and the P_NOSUGID-flag in struct proc itself. One
could use rfork to create a new process with the same descriptor table and call
chroot in the child which would flag the child with P_NOSUGID but change to
root for the parent as well. The parent doesn't get P_NOSUGID however and will
be able to execve a setuid executable with a fake libc.

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the freebsd-bugs mailing list