| Summary: | Double loading of the if_bridge module causes panic | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | Base System | Reporter: | Vladyslav V. Prodan <admin> | ||||||||||
| Component: | bin | Assignee: | Kristof Provost <kp> | ||||||||||
| Status: | Closed FIXED | ||||||||||||
| Severity: | Affects Only Me | CC: | eugen, freebsd | ||||||||||
| Priority: | --- | Keywords: | crash | ||||||||||
| Version: | 11.0-STABLE | Flags: | koobs:
mfc-stable11+
koobs: mfc-stable10+ |
||||||||||
| Hardware: | Any | ||||||||||||
| OS: | Any | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Vladyslav V. Prodan
2017-07-19 18:57:27 UTC
Created attachment 184509 [details]
Screenshot at the beginning of the panic
Created attachment 184510 [details]
kldstat -v
I've looked at this problem for about a month and then it kind of rotted on my shelf because busy IRL. But here's the underlying problems I found which in combination causes this issue: 1) Build system installs kernel modules even if they're built into kernel 2) boot loader doesn't (successfully) check if module exists in kernel and loads it regardless, as long as it's instructed to do so. "kldload" properly checks if the module already exists in the kernel and correctly refuses to load the module. I didn't test all boot loaders but the second problem at least happens with the GPT ZFS loader. Created attachment 185114 [details]
proposed fix
Please try this patch. Apply it and rebuild/reinstall kernel and modules, then repeat the test. It should just complain the module is already present in the kernel and won't panic.
Applied patch to 12-current r321460. Issue occured before patch, not after. With this patch: if_bridge is not loaded when it's compiled into kernel. No error output is printed to dmesg during boot about the module already existing. Seems to work as expected now. A commit references this bug: Author: kp Date: Thu Sep 21 14:14:01 UTC 2017 New revision: 323864 URL: https://svnweb.freebsd.org/changeset/base/323864 Log: bridge: Set module version This ensures that the loader will not load the module if it's also built in to the kernel. PR: 220860 Submitted by: Eugene Grosbein <eugen@freebsd.org> Reported by: Marie Helene Kvello-Aune <marieheleneka@gmail.com> Changes: head/sys/net/if_bridge.c I should probably point out the error in the commit message as I didn't submit the PR. But I did discuss it with kp at length in June. ;) A commit references this bug: Author: kp Date: Sat Sep 30 10:15:04 UTC 2017 New revision: 324115 URL: https://svnweb.freebsd.org/changeset/base/324115 Log: MFC r323864 bridge: Set module version This ensures that the loader will not load the module if it's also built in to the kernel. PR: 220860 Submitted by: Eugene Grosbein <eugen@freebsd.org> Changes: _U stable/11/ stable/11/sys/net/if_bridge.c A commit references this bug: Author: kp Date: Sat Sep 30 10:16:15 UTC 2017 New revision: 324116 URL: https://svnweb.freebsd.org/changeset/base/324116 Log: MFC r323864 bridge: Set module version This ensures that the loader will not load the module if it's also built in to the kernel. PR: 220860 Submitted by: Eugene Grosbein <eugen@freebsd.org> Changes: _U stable/10/ stable/10/sys/net/if_bridge.c Thank you for resolving this (and the merges to both stable branches in particular). |