[Bug 282041] nullfs file mount from within jail does not globalize paths

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 12 Oct 2024 20:36:08 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=282041

            Bug ID: 282041
           Summary: nullfs file mount from within jail does not globalize
                    paths
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: phil@krylov.eu

Created attachment 254190
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=254190&action=edit
A patch for the wrong nullfs mount path in jail

Consider a jail with enforce_statfs=1, allow.mount, allow.mount.nullfs.

# jexec myjail mount -t nullfs /etc/passwd /etc/rc.conf
# jexec cat /etc/rc.conf
.... (passwd content). The mount is working.

# jexec myjail umount /etc/rc.conf  # this fails!
umount: /etc/rc.conf: unknown file system
# jexec myjail mount -t nullfs -p | grep rc.conf  # mount is not visible in
jail

# mount -t nullfs -p | grep rc.conf  # The mount is visible in the host
environment without jail prefix
/etc/passwd      /etc/rc.conf nullfs rw,noatime,nfsv4acls     0 0
# umount /etc/rc.conf  # umount succeeds from the host environment without jail
prefix

The attached patch seems to fix the problem.

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