Public bug reported:

Long time listening first time caller.

Long story short: What used to be an ignored error is now a real error
in 7.0.0-43 and because the wifi dongle sets up a timer when plugged in,
when you unplug it, that memory is freed but the timer still lives on
and tries to trigger that freed memory and can crash the OS.


Package / version: linux-hwe-7.0, 7.0.0-43.43~24.04.1 (noble, 24.04).
Regression from 7.0.0-42.42~24.04.1.

HARDWARE
USB wifi dongle 0cf3:1006 Qualcomm Atheros AR9271 (TP-Link TL-WN322G/TL-WN422G 
class), firmware ath9k_htc/htc_9271-1.4.0.fw (FW 1.4, RMW support On; 
linux-firmware 20240318.git3b128b60-0ubuntu3.1, unchanged between the two 
kernels). Board ASUS Z170M-E D3, BIOS 2604, i7-6700K, USB via the PCH xHCI 
(0000:00:14.0). The dongle runs at high speed (480M).

WHAT HAPPENS ON 7.0.0-43
1. The dongle enumerates, the firmware loads, and the interface wlx... is 
created (renamed from wlan0). No ath9k warnings in the kernel log.
2. Bringing the interface up fails every time. wpa_supplicant: "Could not set 
interface wlx... flags (UP): Message too long", "nl80211: Could not set 
interface ... UP", "Failed to initialize driver interface". NetworkManager: 
"Couldn't initialize supplicant interface ... couldn't grab this interface", 
retried every 10 s; the device stays unavailable.
3. Reproduced on two different USB ports (usb 1-12 on 13 Nov, usb 1-6 on 22 
Nov) and on three boots: 13 Nov 21:35, 13 Nov 21:52, 22 Nov 15:38.
4. On 13 Nov (usb 1-12, after the dongle was re-plugged): "Oops: general 
protection fault ... RIP: __run_timers+0x1ee/0x2d0", "R13: dead000000000122" 
(LIST_POISON2), "Comm: swapper/3", followed by "Kernel panic - not syncing: 
Fatal exception in interrupt", about 0.03 s after the USB re-enumeration (usb 
1-12: USB disconnect at 731.25 s, new device at 742.64 s, oops at 742.81 s). 
Not tainted. It looks like a timer left armed on freed memory. The full pstore 
dump is attached.

REPRODUCTION ON DEMAND (22 Nov, 7.0.0-43, captured live over netconsole)
With the interface stuck in the failed-up state, unplugging the dongle gives, 
10.2 s later, "WARNING: kernel/time/timer.c:1786 at __run_timers+0x2bc/0x2d0" 
on an idle CPU (swapper/0) with "R13: dead000000000122" and a call trace 
identical to the 13 Nov panic. Disconnect at 5882.52 s (usb 1-6: USB 
disconnect; "ath9k_htc: USB layer deinitialized" at 5882.56 s), warning at 
5892.756 s. On 13 Nov the same gap was 11.4 s and it escalated to a general 
protection fault and panic.

FUNCTION TRACE OF THE FAILING "ip link set up" (trace-cmd, function_graph on 
ieee80211_open)
ieee80211_do_open -> drv_start -> ath9k_htc_start runs through all firmware 
commands (each answered in about 0.5 ms, no timeouts), reaches htc_start, 
ieee80211_wake_queues and mod_timer (arms the TX cleanup timer), then returns 
the error. Afterwards, with the interface still down, 
ath9k_htc_tx_cleanup_timer runs every 51 ms (296 calls counted in 15 s with 
bpftrace) and ath9k_htc_stop is never called.

COMPARISON WITH 7.0.0-42 (same dongle, same machine, trace of "ip link set up" 
after taking the interface down)
The sequence of calls inside ath9k_htc_start() is identical on -42 and -43 (all 
WMI commands, ath9k_hw_reset, ath9k_host_rx_init, ath9k_htc_update_cap_target, 
htc_start, ieee80211_wake_queues, mod_timer, ath9k_htc_start_btcoex). On -42 it 
returns 0 and mac80211 continues (drv_add_interface, ieee80211_hw_conf_init, 
...). On -43 the same sequence returns an error and ieee80211_do_open bails out 
immediately after drv_start. So no step is skipped; a return value that used to 
be ignored is now an error. That fits the new check in "wifi: ath9k: reject 
short WMI command responses" (the firmware, FW 1.4, apparently sends a response 
shorter than the driver expects for one command). Not yet identified: which of 
the six WMI commands (one before ath9k_hw_reset, three after it, one in 
ath9k_htc_update_cap_target) returns the error.

HYPOTHESIS (inferred, unproven)
ath9k_htc_start() arms priv->tx.cleanup_timer and then returns an error from an 
earlier WMI command. mac80211 treats the open as failed and never calls 
ath9k_htc_stop(), which is where the timer is cancelled. On disconnect the 
driver frees its private data with the timer still queued, so the timer wheel 
later hits freed memory (__run_timers, list poison). The new 7.0.0-43 changes 
in ath9k WMI response handling are the likely source of the error returned by 
start; the mac80211 teardown changes are not needed to explain the crash.

WHAT WORKS
7.0.0-42.42~24.04.1, same dongle, same machine, ports usb 1-12 and usb 1-6. 
Boot 21 Nov 22:03 to 22 Nov 15:36 (17.5 h): interface up, associated, no 
errors. Boots on 17 Nov, 21 Nov and earlier were also fine.

DIFFERENCE BETWEEN THE TWO BUILDS
ath9k_htc srcversion 8823109551323DE0E77F297 (-42) vs F6A53BB0AFED37B9D311188 
(-43); mac80211 7981B44C8D77DECBE991400 vs 867C7C70CDE39F90EADCB65. ath9k_hw, 
ath9k_common, ath and cfg80211 are unchanged.

CANDIDATE COMMITS in the 7.0.0-43 changelog 
(/usr/share/doc/linux-hwe-7.0-headers-7.0.0-43/changelog.Debian.gz), not tested 
individually:
- wifi: ath9k: reject short WMI command responses (CVE-2026-98828)
- wifi: ath9k_htc: bound TX aggregation to MAX_TX_BUF_SIZE (CVE-2026-98827)
- wifi: mac80211: shut down RX BA session timer on teardown
- wifi: mac80211: drain PS delivery work during station teardown
My guess (unverified): the WMI change makes a short reply during interface-up 
return an error that surfaces as EMSGSIZE ("Message too long") from 
ath9k_htc_start(); see the hypothesis above for the crash.

NOT TRIED
A test kernel with individual commits reverted; kernels newer than 7.0.0-43; 
the generic (non-HWE) 24.04 kernel. I am willing to test a PPA kernel.

WORKAROUND
Boot 7.0.0-42. Do not unplug the dongle while booted on 7.0.0-43 (kernel 
warning, and on one occasion a panic).

Logs from the failing and working boots are attached.

NOTE: i do have some more data collection files but I can only add one
file at the moment.

`failing-7.0.0-43-usb-1-6.txt`, `working-7.0.0-42-usb-1-6.txt`, `pstore-
panic-13nov-7.0.0-43.txt`, `reproduction-unplug-
warn-22nov-7.0.0-43.txt`, `start-path-comparison-42-vs-43.txt`,
`versions-and-suspect-changes.txt`. Also run `apport-collect <bug#>` or
attach the output of `ubuntu-bug linux` on the failing kernel.

** Affects: linux-hwe-7.0 (Ubuntu)
     Importance: Undecided
         Status: New

** Attachment added: "Kernel and wpa_supplicant/NetworkManager log from a 
failing boot: 7.0.0-43-generic, AR9271 dongle (0cf3:1006) on usb 1-6, 22 Nov 
2026. Firmware loads and the interface is created, then every attempt to bring 
it up fails with "Message too long"."
   
https://bugs.launchpad.net/bugs/2175528/+attachment/6020187/+files/failing-7.0.0-43-usb-1-6.txt

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2175528

Title:
  ath9k_htc (AR9271 USB) fails to bring interface up on linux-hwe-7.0
  7.0.0-43 ("Message too long"), kernel panic on unplug; 7.0.0-42 works

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/linux-hwe-7.0/+bug/2175528/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to