Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 17 Feb 2021 18:24:56 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 253593] Process hangs if nullfs mounted cwd moved out of chroot
Message-ID:  <bug-253593-227@https.bugs.freebsd.org/bugzilla/>

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

            Bug ID: 253593
           Summary: Process hangs if nullfs mounted cwd moved out of
                    chroot
           Product: Base System
           Version: 12.2-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: koscak.gregor@gmail.com

Overview:
Moving a current working directory of a chrooted/jailed process, which is
accessed via nullfs mount, to the outside of chroot/jail will hang the proc=
ess
in R state with CPU maxed out. The process cannot be killed. Whether mount =
is
rw or ro makes no difference.

Steps to reproduce:
Setup directories
/test/mounted/subdir
/test/outside
/test/jail  <--- minimum chroot environment, or static shell

With nullfs mount:
host# mount
/test/inside on /test/jail/mnt (nullfs, local, soft-updates)

Procedure:
[terminal1]
host# chroot /test/jail /bin/sh
jail# cd /mnt/subdir
[terminal2]
host# mv /test/mounted/subdir /test/outside
! at this point we have:
! /test/mounted
! /test/outside/subdir
[terminal1]
jail# pwd
/mnt/subdir
jail# cd .

Actual result:
Shell process hangs w/ CPU utilization maxed and cannot be killed (R state).
Nullfs mount cannot be unmounted, results in D state.
Return to normal operation requires reboot.

Expected result:
Graceful failure.

Tested on:
12.2-RELEASE-p1, 12.2-RELEASE-p3, physical and virtual (virtualbox).
14.0-CURRENT will panic the kernel.

--=20
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-253593-227>