DF-4529 / panic.open.txt
Fatal trap 12: page fault while in kernel mode [pre-v2-fix stress, boot @ ~05:47] cpuid = 3; lapic id = 3 [...] current process = 633 (an /root/nvspam re-glob/re-open) kernel: type 12 trap, code=0 CPU3 stopping CPUs: 0x00000037 stopped Stopped at nvme_open+0x13: testb $0x2,0x44c(%rdx) db> # Context: 6x detach/attach cycles with the v1-fixed kernel. v1 closed the # ioctl path; this crash is the SAME teardown-lifetime defect surfacing # through nvme_open(): a spammer's open() dispatched on a devfs node whose # si_drv1 still pointed at the kfree'd softns, so `sc = nsc->sc` yielded a # dangling softc pointer and the NVME_SC_UNLOADING check faulted reading # sc->flags (offset 0x44c). Motivated fix v2: NULL cdev->si_drv1 at # nvme_disk_detach() + NULL guards at every dispatch entry. # (Reconstructed from the serial console tail captured at crash time; each # QEMU boot truncates boot-nvme.log, so the raw block was not retained.)