Bug 141678 - [patch] A minor enhancement to how /etc/rc.d/jail determines mount points used in jails
Summary: [patch] A minor enhancement to how /etc/rc.d/jail determines mount points use...
Status: Closed Overcome By Events
Alias: None
Product: Base System
Classification: Unclassified
Component: conf (show other bugs)
Version: 8.0-STABLE
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-rc (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-12-16 12:40 UTC by Markiyan Kushnir
Modified: 2016-01-25 20:13 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (2.02 KB, patch)
2009-12-16 12:40 UTC, Markiyan Kushnir
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Markiyan Kushnir 2009-12-16 12:40:00 UTC
As a part of jail cleanup the /etc/rc.d/jail script performs un-mount of the configured mount points, such as dev, fdesc, proc, as well as those in the jail's fstab file. To safely umount the mount point, it first checks if it is really a mount point, calling is_current_mountpoint(). This function performs rather naive path normalization, which fails if there are "/./" present in the mount point path. It can occur if, for example, the fstab file if automatically generated. Such paths are, however, perfectly valid input to the mount(8).

Please consider a little bit advanced version of the path normalization, which I propose to put in the rc.subr.

Fix: Please see the patch attached.

Patch attached with submission follows:
How-To-Repeat: One might have the following fstab:

/data/test-release/R/stage/trees/base/bin  /usr/jails/M/./bin  nullfs ro 0 0
/data/test-release/R/stage/trees/base/boot /usr/jails/M/./boot nullfs ro 0 0
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2009-12-16 12:53:17 UTC
Responsible Changed
From-To: freebsd-bugs->freebsd-rc

Over to maintainer(s).
Comment 2 Jamie Gritton freebsd_committer freebsd_triage 2016-01-25 20:13:49 UTC
As of 10-STABLE, the path check is done in jail(8) and the problematic code no longer exists.