Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 08 Jun 2014 23:36:45 +0000
From:      bz-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 121073] [kernel] [patch] run chroot as an unprivileged user
Message-ID:  <bug-121073-8-1wJ45O4hNY@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-121073-8@https.bugs.freebsd.org/bugzilla/>
References:  <bug-121073-8@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=121073

--- Comment #7 from Jille@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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-121073-8-1wJ45O4hNY>