[Bug 274375] page fault while load kernel module virtio

From: <bugzilla-noreply_at_freebsd.org>
Date: Tue, 02 Apr 2024 15:21:20 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=274375

--- Comment #4 from Zhenlei Huang <zlei@FreeBSD.org> ---
(In reply to Mark Johnston from comment #1)
> This looks like a problem with DTrace, there is some logic in sdt.ko's kldunload
> handler to unregister providers, and something's going wrong there.  virtqueue.c
> defines two rather odd SDT probes, so we're trying to unregister them.

That happens when a module file with SDT probes is failed to be loaded by
kernel linker. While the kernel try to invoke kld_unload_try event handlers for
it and apparently it should not, as the file is in the progress of loading,
i.e. it is partially linked.

As for 
> Note: `kldload virtio.ko` can trigger the panic but `kldload virtio` will not.
kernel linkers will check module named `virtio` firstly and refuse to load so
no bad things happen. But for `virtio.ko` the kernel will load the file and get
all modules in it before it knows `virtio` is present.

Proposed fix https://reviews.freebsd.org/D44594.

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