Bug 258815

Summary: Boot panics when KMSAN enabled after 6687410af7d..d3a8f98acbf
Product: Base System Reporter: Li-Wen Hsu <lwhsu>
Component: kernAssignee: Mark Johnston <markj>
Status: Closed FIXED    
Severity: Affects Only Me CC: cperciva, emaste, markj, mav
Priority: --- Keywords: regression
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
verbose boot message none

Description Li-Wen Hsu freebsd_committer freebsd_triage 2021-09-30 17:06:54 UTC
Created attachment 228294 [details]
verbose boot message

After 6687410af7d..d3a8f98acbf , kernel with KMSAN enabled panics on boot.

https://ci.freebsd.org/job/FreeBSD-main-amd64-KMSAN_test/55/console

panic: MSan: Uninitialized malloc memory from g_read_data+0x26f
cpuid = 1
time = 2
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x9b/frame 0xfffffe000779a600
vpanic() at vpanic+0x567/frame 0xfffffe000779a6a0
panic() at panic+0x1b3/frame 0xfffffe000779a7b0
__msan_warning() at __msan_warning+0x255/frame 0xfffffe000779a900
readsuper() at readsuper+0x5f6/frame 0xfffffe000779a9b0
ffs_sbget() at ffs_sbget+0x2c7/frame 0xfffffe000779aac0
g_label_ufs_taste_common() at g_label_ufs_taste_common+0x1e8/frame 0xfffffe000779abe0
g_label_taste() at g_label_taste+0x5ed/frame 0xfffffe000779ad60
g_new_provider_event() at g_new_provider_event+0x5c4/frame 0xfffffe000779ade0
g_run_events() at g_run_events+0x6d3/frame 0xfffffe000779aea0
fork_exit() at fork_exit+0x1c9/frame 0xfffffe000779af30
fork_trampoline() at fork_trampoline+0xe/frame 0xfffffe000779af30
--- trap 0x800001, rip = 0, rsp = 0, rbp = 0xfffffe0000000000 ---
??() at 0/frame 0xfffffe0000000000
KDB: enter: panic
[ thread pid 13 tid 100037 ]
Stopped at      kdb_enter+0x15f:        movq    $0x863a5890,%rdi
db>

The commits included in this build are:
base d3a8f98acbf51e728411f10c5f179a30b9ca683c                                        
base 0a35c4b3cab563e3ab1bf5b7b49bf26e0bb7cb04                                        
base 242923eb848a94d657344c2ff45c4f15433cdf3c
Comment 1 Mark Johnston freebsd_committer freebsd_triage 2021-09-30 17:14:15 UTC
I suspect this is not related to recent commits.  I note that the CI VMs are using virtual SATA disks, while most of the initial KMSAN work was done using virtio devices.  So this is likely a preexisting driver problem or a false positive (i.e., KMSAN bug) of some kind.
Comment 2 Li-Wen Hsu freebsd_committer freebsd_triage 2021-09-30 17:32:00 UTC
(In reply to Mark Johnston from comment #1)
I was also suspecting this, and did a bisect for this. The build for base 6687410af7dba54e19b773684a969e9c590999e4 doesn't have this message:

https://ci.freebsd.org/job/FreeBSD-main-amd64-KMSAN_test/57/console
Comment 3 Mark Johnston freebsd_committer freebsd_triage 2022-01-20 15:20:55 UTC
Should be fixed by https://cgit.FreeBSD.org/src/commit/?id=d91d2b513eb30a226e87f0e52e2f9f232a2e1ca3
Comment 4 Mark Johnston freebsd_committer freebsd_triage 2022-03-28 18:16:24 UTC
This is fixed now.  The regression test is not yet KMSAN-clean, but we're getting there.