Bug 290636 - kernel panic in linuxkpi_ieee80211_next_txq
Summary: kernel panic in linuxkpi_ieee80211_next_txq
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: wireless (show other bugs)
Version: 15.0-STABLE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Bjoern A. Zeeb
URL:
Keywords: crash
: 295752 (view as bug list)
Depends on:
Blocks: rtw8x
  Show dependency tree / graph
 
Reported: 2025-10-28 16:57 UTC by Tilman Keskinoz
Modified: 2026-06-01 14:40 UTC (History)
2 users (show)

See Also:
bz: mfc-stable15+
bz: mfc-stable14+
bz: mfc-stable13-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tilman Keskinoz freebsd_committer freebsd_triage 2025-10-28 16:57:27 UTC
#0  __curthread () at /usr/src/sys/amd64/include/pcpu_aux.h:57
#1  doadump (textdump=<optimized out>) at /usr/src/sys/kern/kern_shutdown.c:399
#2  0xffffffff83d86ee0 in vt_drmfb_postswitch () from /boot/modules/drm.ko
#3  0xffffffff809afac5 in vt_window_switch (vw=vw@entry=0xffffffff818a37e8 <vt_conswindow>)
   at /usr/src/sys/dev/vt/vt_core.c:626
#4  0xffffffff809b0ebf in vtterm_cngrab (tm=<unavailable>,  
   tm@entry=<error reading variable: value is not available>) at /usr/src/sys/dev/vt/vt_core.c:2059
#5  0xffffffff80b022a6 in cngrab () at /usr/src/sys/kern/kern_cons.c:407
#6  0xffffffff80b7364e in vpanic (fmt=0xffffffff811d3167 "%s", ap=ap@entry=0xfffffe00cacd2bb0)
   at /usr/src/sys/kern/kern_shutdown.c:946
#7  0xffffffff80b73563 in panic (fmt=<unavailable>) at /usr/src/sys/kern/kern_shutdown.c:887
#8  0xffffffff8107bf69 in trap_fatal (frame=<optimized out>, eva=<optimized out>)
   at /usr/src/sys/amd64/amd64/trap.c:969
#9  0xffffffff8107bf69 in trap_pfault (frame=0xfffffe00cacd2c30, usermode=false, signo=<optimized out>,  
   ucode=<optimized out>)
#10 <signal handler called>
#11 0xffffffff80de9483 in linuxkpi_ieee80211_next_txq (hw=hw@entry=0xfffffe01217a44c0, ac=ac@entry=2 '\002')
   at /usr/src/sys/compat/linuxkpi/common/src/linux_80211.c:8652
#12 0xffffffff83e05f66 in ieee80211_next_txq (hw=0xfffffe01217a44c0, ac=2 '\002')
   at /usr/src/sys/compat/linuxkpi/common/include/net/mac80211.h:1425
#13 rtw89_core_txq_schedule (rtwdev=0xfffffe01217a4580, ac=2 '\002', reinvoke=<optimized out>)
   at /usr/src/sys/contrib/dev/rtw89/core.c:3170
#14 rtw89_core_txq_work (w=<optimized out>) at /usr/src/sys/contrib/dev/rtw89/core.c:3215
#15 0xffffffff80e09d44 in linux_work_fn (context=0xfffffe01217a4f70, pending=<optimized out>)
   at /usr/src/sys/compat/linuxkpi/common/src/linux_work.c:308
#16 0xffffffff80bd6f12 in taskqueue_run_locked (queue=queue@entry=0xfffff80001d95400)
   at /usr/src/sys/kern/subr_taskqueue.c:517
#17 0xffffffff80bd80e2 in taskqueue_thread_loop (arg=arg@entry=0xfffff8000174b580)
   at /usr/src/sys/kern/subr_taskqueue.c:829
#18 0xffffffff80b299fb in fork_exit (callout=0xffffffff80bd8020 <taskqueue_thread_loop>,  
   arg=0xfffff8000174b580, frame=0xfffffe00cacd2f40) at /usr/src/sys/kern/kern_fork.c:1153
#19 <signal handler called>

(kgdb) fr 11
#11 0xffffffff80de9483 in linuxkpi_ieee80211_next_txq (hw=hw@entry=0xfffffe01217a44c0, ac=ac@entry=2 '\002')
   at /usr/src/sys/compat/linuxkpi/common/src/linux_80211.c:8652
8652            TAILQ_REMOVE(&lhw->scheduled_txqs[ac], ltxq, txq_entry);
(kgdb) p lhw
$1 = (struct lkpi_hw *) 0xfffffe01217a4240
(kgdb) p ac
$2 = 2 '\002'
(kgdb) p ltxq
$3 = (struct lkpi_txq *) 0xfffff801b5563700
(kgdb) p txq_entry
No symbol "txq_entry" in current context.
(kgdb) p lhw->scheduled_txqs[ac]
$4 = {tqh_first = 0xfffff801b5563700, tqh_last = 0x0}
(kgdb)
Comment 1 Bjoern A. Zeeb freebsd_committer freebsd_triage 2025-12-08 00:44:34 UTC
Hi,

it's been a bit but I just wanted to let you know that I got a similar/same panic (I have a debug kernel on so an assert might have caught it; and I have local modifications):

/sys/compat/linuxkpi/common/src/linux_80211.c:8723: linuxkpi_ieee80211_next_txq: Bad link elm 0xfffff800036fa300 prev->next != elm
cpuid = 2
time = 1765156399
KDB: stack backtrace:
db_trace_self_wrapper() at db_trace_self_wrapper+0x2b/frame 0xfffffe0069e87a40
vpanic() at vpanic+0x136/frame 0xfffffe0069e87b70
panic() at panic+0x43/frame 0xfffffe0069e87bd0
linuxkpi_ieee80211_next_txq() at linuxkpi_ieee80211_next_txq+0xe6/frame 0xfffffe0069e87bf0
...

I'll try to work through this during the week.
Comment 2 commit-hook freebsd_committer freebsd_triage 2025-12-11 00:47:00 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=567a097c8ab60d9fcd68a87c3c5ad605fe8715cc

commit 567a097c8ab60d9fcd68a87c3c5ad605fe8715cc
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-12-10 20:29:23 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-12-11 00:46:15 +0000

    LinuxKPI: 802.11: lock down the "txq_scheduled" tailq

    For consistency rename the "scheduled_txqs" tailq to
    "txq_scheduled" and add a lock per txq ("txq_scheduled_lock[]").
    We use the "_bh" locking as this called from the device driver.

    This fixes panics due to concurrent access to the tailq, especially
    in between "first" and "remove" on the out-direction and between
    "insert" and "elem_init" on the in-direction.

    This was easily reproducible just running iperf3 at basic rates for
    a few seconds to minutes with multiple chipsets, not only rtw89.

    Sponsored by:   The FreeBSD Foundation
    PR:             290636
    Reported by:    arved, and others before
    MFC after:      3 days

 sys/compat/linuxkpi/common/src/linux_80211.c | 51 ++++++++++++++++++++++------
 sys/compat/linuxkpi/common/src/linux_80211.h |  3 +-
 2 files changed, 42 insertions(+), 12 deletions(-)
Comment 3 commit-hook freebsd_committer freebsd_triage 2025-12-15 18:11:02 UTC
A commit in branch stable/15 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2e1156f75836a0e5a4026e13d72b54f272e705cb

commit 2e1156f75836a0e5a4026e13d72b54f272e705cb
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-12-10 20:29:23 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2025-12-15 18:09:22 +0000

    LinuxKPI: 802.11: lock down the "txq_scheduled" tailq

    For consistency rename the "scheduled_txqs" tailq to
    "txq_scheduled" and add a lock per txq ("txq_scheduled_lock[]").
    We use the "_bh" locking as this called from the device driver.

    This fixes panics due to concurrent access to the tailq, especially
    in between "first" and "remove" on the out-direction and between
    "insert" and "elem_init" on the in-direction.

    This was easily reproducible just running iperf3 at basic rates for
    a few seconds to minutes with multiple chipsets, not only rtw89.

    Sponsored by:   The FreeBSD Foundation
    PR:             290636
    Reported by:    arved, and others before

    (cherry picked from commit 567a097c8ab60d9fcd68a87c3c5ad605fe8715cc)

 sys/compat/linuxkpi/common/src/linux_80211.c | 51 ++++++++++++++++++++++------
 sys/compat/linuxkpi/common/src/linux_80211.h |  3 +-
 2 files changed, 42 insertions(+), 12 deletions(-)
Comment 4 commit-hook freebsd_committer freebsd_triage 2026-01-16 19:42:28 UTC
A commit in branch stable/14 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=8fc0789a4dda595311bec566719ff3c2e2744ee2

commit 8fc0789a4dda595311bec566719ff3c2e2744ee2
Author:     Bjoern A. Zeeb <bz@FreeBSD.org>
AuthorDate: 2025-12-10 20:29:23 +0000
Commit:     Bjoern A. Zeeb <bz@FreeBSD.org>
CommitDate: 2026-01-16 19:37:55 +0000

    LinuxKPI: 802.11: lock down the "txq_scheduled" tailq

    For consistency rename the "scheduled_txqs" tailq to
    "txq_scheduled" and add a lock per txq ("txq_scheduled_lock[]").
    We use the "_bh" locking as this called from the device driver.

    This fixes panics due to concurrent access to the tailq, especially
    in between "first" and "remove" on the out-direction and between
    "insert" and "elem_init" on the in-direction.

    This was easily reproducible just running iperf3 at basic rates for
    a few seconds to minutes with multiple chipsets, not only rtw89.

    Sponsored by:   The FreeBSD Foundation
    PR:             290636
    Reported by:    arved, and others before

    (cherry picked from commit 567a097c8ab60d9fcd68a87c3c5ad605fe8715cc)
    (cherry picked from commit 2e1156f75836a0e5a4026e13d72b54f272e705cb)

 sys/compat/linuxkpi/common/src/linux_80211.c | 51 ++++++++++++++++++++++------
 sys/compat/linuxkpi/common/src/linux_80211.h |  3 +-
 2 files changed, 42 insertions(+), 12 deletions(-)
Comment 5 Bjoern A. Zeeb freebsd_committer freebsd_triage 2026-01-16 19:57:08 UTC
I believe this should be fixed in all relevant branches.
In case the problem still exists after the MFC dates, please re-open.
Comment 6 Bjoern A. Zeeb freebsd_committer freebsd_triage 2026-06-01 14:40:05 UTC
*** Bug 295752 has been marked as a duplicate of this bug. ***