DF-4749 / run.log
# DF-4749 baseline (PRE-FIX nmdm.ko) evidence โ DragonFly 6.5-DEVELOPMENT x86_64 guest
# /dev/nmdm0A,B created by `kldload nmdm` -> nmdminit() -> make_dev(...,0666) (nmdm.c:127-130)
## Part A โ unprivileged UNJAILED baseline (uid 1001 maxx):
uid=1001(maxx) gid=1001(maxx) groups=1001(maxx)
== DF-4749: reopen of an open nmdm half ==
open#1(/dev/nmdm0A) = 3 [ok, TS_ISOPEN set]
open#2(/dev/nmdm0A) = 4 [correct: reopen allowed]
open#3 after close(#1) = 3 [ok: fresh first-open works]
=> for unjailed users the prison check (nmdm.c:211) is INERT:
pt_prison==NULL == cr_prison==NULL (kern_prot.c:1223) -> never EBUSY.
## Part B โ jailed holder + same-jail reopen (rigorous, pre-fix):
== starting jailed holder on /dev/nmdm0A ==
holder: open(/dev/nmdm0A)=3 holding 60s
== jailed process reopens own jail half:
== DF-4749: reopen of an open nmdm half ==
FAIL setup: open#1(/dev/nmdm0A): Device busy
=> BUG direction 1: pt_prison(NULL) != cr_prison(&jail) ALWAYS true for
jailed openers (nmdm.c:211) โ a jail cannot even reopen its own half.
== jail pid check: holder alive? ==
1278 /tmp/holder /dev/nmdm0A
holder: open(/dev/nmdm0A)=3 holding 60s
== unprivileged UNJAILED attach while jail holds the half (user maxx) ==
holder: open(/dev/nmdm0A)=3 holding 60s
=> BUG direction 2: intended prison affinity never fires for the
unjailed side โ unprivileged host user shares the jail's tty half.