[Bug 290968] Dynamic linuxbase loading can mount in unexpected locations

From: <bugzilla-noreply_at_freebsd.org>
Date: Wed, 12 Nov 2025 07:08:23 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290968

            Bug ID: 290968
           Summary: Dynamic linuxbase loading can mount in unexpected
                    locations
           Product: Base System
           Version: 15.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: conf
          Assignee: bugs@FreeBSD.org
          Reporter: morganw@gmail.com

Created attachment 265354
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=265354&action=edit
Potential fix, falling back to /compat/linux if the sysctl does not exist

The /etc/rc.d/linux module sets _emul_path from the compat.linux.emul_path
sysctl, but does not verify that the variable exists. If it does not exist,
$_emul_path will be empty, and with linux_mounts_enable=YES (the default), the
script will try to mount linsysfs and linprocfs to /sys and /proc, which can
lead to some "double mounts" and interesting side effects for /sys.

This occurred on a working system after upgrading to 15-STABLE. The linux
module failed to load due to a missing mqueuefs dependency, and /usr/src/sys
seemed to vanish until it became clear what happened.

Better behavior might be to exit or fall back to /compat/linux for the mounts.

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