Summary: | panic: _sx_xlock_hard: recursed on non-recursive sx iflib ctx lock @ /usr/src/sys/net/iflib.c:2582 | ||
---|---|---|---|
Product: | Base System | Reporter: | Piotr Kubaj <pkubaj> |
Component: | kern | Assignee: | freebsd-bugs (Nobody) <bugs> |
Status: | Closed FIXED | ||
Severity: | Affects Only Me | CC: | erj, grahamperrin, przemyslawx.lewandowski |
Priority: | --- | Keywords: | crash, iflib |
Version: | CURRENT | ||
Hardware: | Any | ||
OS: | Any |
Description
Piotr Kubaj
![]() ![]() This issue also happens if I disable devmatch and load the ice module manually. For some reason it doesn't happen during autoloading with enabled devmatch. I added "devmatch_blocklist="if_ice"" in /etc/rc.conf and automatically reload doesn't occur. It helps to confirm that panic exists only during load driver. It looks like the CTX_LOCK is already locked in iflib_media_status. I remember that a few weeks ago disabling NETLINK was helping but not now. CTX is locked first in iflib_device_register and second in iflib_media_status(here panic). SIOCGIFMEDIA is received in iflib_if_ioctl(then ifmedia_ioctl -> iflib_media_status) but on 13.2 it is not sent from get_operstate_ether() in netlink module. On 14.0 is sent from netlink. Can issue be related to ifnet_arrival_event? It needs to be investigated more. Prepared fix for this: https://reviews.freebsd.org/D40557 A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d Author: Eric Joyner <erj@FreeBSD.org> AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner <erj@FreeBSD.org> CommitDate: 2023-07-19 22:51:26 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 271768 Reviewed by: erj@, jhb@ MFC after: 1 day Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) A commit in branch stable/13 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=93f39b4675865094b298e1fca5bcfa788348dd36 commit 93f39b4675865094b298e1fca5bcfa788348dd36 Author: Przemyslaw Lewandowski <przemyslawx.lewandowski@intel.com> AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner <erj@FreeBSD.org> CommitDate: 2023-07-20 22:42:22 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 271768 Reviewed by: erj@, jhb@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 (cherry picked from commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d) sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) A commit in branch stable/12 references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=2617bca5a8c98e9e84fba3f2ebd9302e8e893b8f commit 2617bca5a8c98e9e84fba3f2ebd9302e8e893b8f Author: Przemyslaw Lewandowski <przemyslawx.lewandowski@intel.com> AuthorDate: 2023-07-19 22:40:46 +0000 Commit: Eric Joyner <erj@FreeBSD.org> CommitDate: 2023-07-20 22:56:41 +0000 iflib: Unlock ctx lock around call to ether_ifattach() Panic occurs during loading driver using kldload. It exists since netlink is enabled. There is problem with double locking ctx. This fix allows to call ether_ifattach() without locked ctx. Signed-off-by: Eric Joyner <erj@FreeBSD.org> PR: 271768 Reviewed by: erj@, jhb@ Sponsored by: Intel Corporation Differential Revision: https://reviews.freebsd.org/D40557 (cherry picked from commit a52f23f4c49e4766fb9eb0bf460cc83c5f63f17d) sys/net/iflib.c | 6 ++++++ 1 file changed, 6 insertions(+) At least at Intel, Przemyslaw's fix did fix this issue for us. |