[Bug 290352] mdo(1) causes kernel panic in jail

From: <bugzilla-noreply_at_freebsd.org>
Date: Sat, 18 Oct 2025 23:13:44 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290352

            Bug ID: 290352
           Summary: mdo(1) causes kernel panic in jail
           Product: Base System
           Version: 15.0-STABLE
          Hardware: amd64
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: bin
          Assignee: bugs@FreeBSD.org
          Reporter: 0x1eef@protonmail.com

Created attachment 264705
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=264705&action=edit
Screenshot of the panic

## Problem

When I run 'mdo -u user env' in a jail, I observe a kernel panic. 
Screenshot attached.

## Environment

Commit e504946ee119c4bd3940bea798bd47e85b0a25d0

I have configured the host to enable mac_do via /boot/loader.conf:
mac_do_load="YES"

I have configured the jail like so:
cat /etc/jail.conf.d/2.turtle.home.network | grep mac
mac.do.rules = "uid=1001>uid=0,gid=0";

## Reproduction

jexec jail
sysctl security.mac.do.rules='uid=0>any'
mdo -u user env
[panic]

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