NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/52351: namei needs to take more rootdir refs



>Number:         52351
>Category:       kern
>Synopsis:       namei needs to take more rootdir refs
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Jul 01 00:20:01 +0000 2017
>Originator:     David A. Holland
>Release:        NetBSD 7.99.65 (20170309)
>Organization:
>Environment:
System: NetBSD macaran 7.99.65 NetBSD 7.99.65 (MACARAN) #41: Thu Mar 9 19:33:59 EST 2017 dholland@macaran:/usr/src/sys/arch/amd64/compile/MACARAN amd64
Architecture: x86_64
Machine: amd64
>Description:

namei saves pointers to the root vnode and emulation root vnode in
struct nameidata.

These do not have their own references to these vnodes and can
conceivably go stale if another thread in the same process chroots.

From mjg@freebsd.

>How-To-Repeat:

>Fix:

Not entirely trivial as struct nameidata is owned by the caller and
never explicitly destroyed/released. Hopefully no caller is actually
using these fields and they can quietly get shifted into struct
namei_state and disappear.

(Fortunately, no program in its right mind chroots concurrently while
doing other fs operations, and screwing around on purpose will require
root.)



Home | Main Index | Thread Index | Old Index