All of lore.kernel.org
 help / color / mirror / Atom feed
* [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug
@ 2026-08-28  5:25 Farhad Alemi
  2026-11-09 10:34 ` Chad Aldreda
  0 siblings, 1 reply; 4+ messages in thread
From: Farhad Alemi @ 2026-08-28  5:25 UTC (permalink / raw)
  To: Toke Høiland-Jørgensen, Jeff Johnson
  Cc: falemi, linux-wireless, linux-kernel

Hello,

As part of the kernel research at ASU's SEFCOM
lab, we hit the crash below. Crash reports can be found here:

  https://github.com/farhad-alemi/public_bug_reports/tree/main/137-ath9k_htc-timer-outlives-wiphy/

  usb 1-1: USB disconnect, device number 5
  ODEBUG: free active (active state 0) object: ffff88811ead3940 object
type: timer_list hint: ath9k_htc_tx_cleanup_timer+0x0/0x4d0
  WARNING: lib/debugobjects.c:632 at debug_print_object+0xec/0x230,
CPU#0: kworker/0:3/2242
  Workqueue: usb_hub_wq hub_event
  Call Trace:
   debug_check_no_obj_freed+0x3a2/0x470
   __free_frozen_pages+0x5d1/0xd90
   device_release+0xc4/0x1f0
   kobject_put+0x228/0x560
   ath9k_hif_usb_disconnect+0x135/0x240
   usb_unbind_interface+0x26e/0x910
   device_release_driver_internal+0x4d9/0x870
   bus_remove_device+0x455/0x570
   device_del+0x527/0x8f0

  BUG: KASAN: slab-use-after-free in _raw_spin_lock+0x2e/0x40
  Read of size 1 at addr ffff888105d701c0 by task kworker/0:3/2242
  Call Trace:
   <IRQ>
   lock_acquire+0x84/0x350
   _raw_spin_lock+0x2e/0x40
   ath9k_htc_tx_cleanup_timer+0x57/0x4d0
   call_timer_fn+0x18d/0x5f0
   __run_timer_base+0x652/0x8b0
   run_timer_softirq+0xb7/0x170
   handle_softirqs+0x22c/0x860
   </IRQ>

Our reproducer.c is available upon request.

Happy to test a patch if that would help.

Regards,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug
  2026-08-28  5:25 [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug Farhad Alemi
@ 2026-11-09 10:34 ` Chad Aldreda
  2026-11-20 17:21   ` Farhad Alemi
  0 siblings, 1 reply; 4+ messages in thread
From: Chad Aldreda @ 2026-11-09 10:34 UTC (permalink / raw)
  To: Farhad Alemi
  Cc: Toke Høiland-Jørgensen, Jeff Johnson, falemi,
	linux-wireless, linux-kernel

Hi Farhad,

Could you share the reproducer for this one?

Two paths in the code would fit the report. Both end the same way:
the timer re-arms itself (ath9k_htc_tx_cleanup_timer()), and nothing
deletes it before ath9k_htc_disconnect_device() frees the hw.

1. ath9k_fatal_work() calls ath9k_htc_reset(), which re-arms
   tx.cleanup_timer without checking ATH_OP_INVALID. A WMI_FATAL_EVENTID
   (or beacon-stuck SWBA) that arrives after ath9k_htc_stop() has
   finished still queues fatal_work, since WMI events are processed
   until ath9k_stop_wmi(). The timer is then armed on a stopped device,
   and ieee80211_unregister_hw() does not call stop again.

2. Inside ath9k_htc_stop(), the timer is deleted and priv->mutex is
   dropped before cancel_work_sync(&priv->fatal_work). A fatal_work
   already waiting on the mutex runs the reset in that gap and re-arms
   the timer.

I'd like to know which one your reproducer hits before proposing a
fix. Does it send WMI_FATAL_EVENTID (or let beacons go stuck in
AP/IBSS/mesh mode), and is the interface up or down when it does?

The code reading above was done with an AI assistant (Claude). Nothing
has been tested yet.

Thanks,
Chad


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug
  2026-11-09 10:34 ` Chad Aldreda
@ 2026-11-20 17:21   ` Farhad Alemi
  2026-11-20 18:26     ` Chad Aldreda
  0 siblings, 1 reply; 4+ messages in thread
From: Farhad Alemi @ 2026-11-20 17:21 UTC (permalink / raw)
  To: Chad Aldreda
  Cc: Toke Høiland-Jørgensen, Jeff Johnson, falemi,
	linux-wireless, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 25064 bytes --]

Hi Chad,

Attaching the reproducer;
Here's what I've on my end:
Linux version 7.4.0-rc3-00406-g65e4fd942f72 _ UpstreamAppArmorKASAN.config

[   47.094450][ T5080] ODEBUG: free active (active state 0) object:
ffff8880232eb9d8 object type: timer_list hint:
ath9k_htc_tx_cleanup_timer+0x0/0x4d0
[   47.094484][ T5080] WARNING: lib/debugobjects.c:632 at
debug_print_object+0xec/0x230, CPU#1: kworker/1:3/5080
[   47.097170][ T5080] Modules linked in:
[   47.097553][ T5080] CPU: 1 UID: 0 PID: 5080 Comm: kworker/1:3 Not
tainted 7.4.0-rc3-00406-g65e4fd942f72 #1 PREEMPT(full)
[   47.098571][ T5080] Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[   47.099555][ T5080] Workqueue: usb_hub_wq hub_event
[   47.100033][ T5080] RIP: 0010:debug_print_object+0x18a/0x230
[   47.100612][ T5080] Code: f8 48 c1 e8 03 80 3c 18 00 74 08 4c 89 ff
e8 dd 00 5d fd 4d 8b 0f 4c 89 ef 48 8b 74 24 08 48 89 ea 44 89 e1 4d
89 f0 ff 34 24 <67> 48 0f b9 3a 48 83 c4 08 ff 05 b3 e5 94 0b 48 83 c4
10 5b 41 5c
[   47.102516][ T5080] RSP: 0000:ffffc900073d71b0 EFLAGS: 00010246
[   47.103077][ T5080] RAX: 1ffffffff181f204 RBX: dffffc0000000000
RCX: 0000000000000000
[   47.103805][ T5080] RDX: ffffffff8c6d6240 RSI: ffffffff8c6d5cc0
RDI: ffffffff908259e0
[   47.104535][ T5080] RBP: ffffffff8c6d6240 R08: ffff8880232eb9d8
R09: ffffffff8c0fa380
[   47.105261][ T5080] R10: dffffc0000000000 R11: ffffffff81b485d0
R12: 0000000000000000
[   47.105997][ T5080] R13: ffffffff908259e0 R14: ffff8880232eb9d8
R15: ffffffff8c0f9020
[   47.106726][ T5080] FS:  0000000000000000(0000)
GS:ffff8881da31c000(0000) knlGS:0000000000000000
[   47.107542][ T5080] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   47.108148][ T5080] CR2: 0000555c9014c710 CR3: 000000010adc9000
CR4: 0000000000752ef0
[   47.108880][ T5080] PKRU: 55555554
[   47.109216][ T5080] Call Trace:
[   47.109538][ T5080]  <TASK>
[   47.109818][ T5080]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.110436][    C1]
==================================================================
[   47.111264][    C1] BUG: KASAN: slab-use-after-free in
_raw_spin_lock+0x2e/0x40
[   47.111997][    C1] Read of size 1 at addr ffff888023b881c0 by task
kworker/1:3/5080
[   47.112746][    C1]
[   47.112978][    C1] CPU: 1 UID: 0 PID: 5080 Comm: kworker/1:3 Not
tainted 7.4.0-rc3-00406-g65e4fd942f72 #1 PREEMPT(full)
[   47.113987][    C1] Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[   47.114961][    C1] Workqueue: usb_hub_wq hub_event
[   47.115437][    C1] Call Trace:
[   47.115748][    C1]  <IRQ>
[   47.116019][    C1]  dump_stack_lvl+0xe8/0x150
[   47.116456][    C1]  print_address_description+0x55/0x1e0
[   47.116968][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.117409][    C1]  print_report+0x58/0x70
[   47.117815][    C1]  kasan_report+0x117/0x150
[   47.118239][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.118682][    C1]  __kasan_check_byte+0x2a/0x40
[   47.119137][    C1]  lock_acquire+0x7d/0x350
[   47.119565][    C1]  ? lock_acquire+0x115/0x350
[   47.120008][    C1]  _raw_spin_lock+0x2e/0x40
[   47.120435][    C1]  ? ath9k_htc_tx_cleanup_timer+0x57/0x4d0
[   47.120976][    C1]  ath9k_htc_tx_cleanup_timer+0x57/0x4d0
[   47.121608][    C1]  call_timer_fn+0x18d/0x5f0
[   47.122065][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.122672][    C1]  ? call_timer_fn+0xd5/0x5f0
[   47.123110][    C1]  ? __pfx_call_timer_fn+0x10/0x10
[   47.123592][    C1]  ? _raw_spin_unlock_irq+0x23/0x50
[   47.124075][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.124657][    C1]  __run_timer_base+0x652/0x8b0
[   47.125109][    C1]  ? lock_acquire+0x115/0x350
[   47.125555][    C1]  ? __pfx___run_timer_base+0x10/0x10
[   47.126054][    C1]  run_timer_softirq+0xb7/0x170
[   47.126510][    C1]  handle_softirqs+0x26a/0x8d0
[   47.126961][    C1]  __irq_exit_rcu+0xc6/0x220
[   47.127398][    C1]  irq_exit_rcu+0x9/0x30
[   47.127797][    C1]  sysvec_apic_timer_interrupt+0xa6/0xc0
[   47.128317][    C1]  </IRQ>
[   47.128597][    C1]  <TASK>
[   47.128876][    C1]  asm_sysvec_apic_timer_interrupt+0x1a/0x20
[   47.129438][    C1] RIP: 0010:__nbcon_atomic_flush_pending_con+0x261/0x370
[   47.130087][    C1] Code: 00 02 00 00 75 41 e8 1e 1f 21 00 4d 85 ed
4c 8d 7c 24 40 75 0c e8 0f 1f 21 00 45 84 e4 75 0d eb 3b e8 03 1f 21
00 fb 45 84 e4 <74> 30 f6 44 24 50 02 49 bc 00 00 00 00 00 fc ff df 74
34 e8 e7 1e
[   47.131969][    C1] RSP: 0000:ffffc900073d6a80 EFLAGS: 00000202
[   47.132565][    C1] RAX: ffffffff81a7a58d RBX: 0000000000000949
RCX: ffff8881072b2640
[   47.133290][    C1] RDX: 0000000000000000 RSI: 0000000000000000
RDI: 0000000000000000
[   47.134020][    C1] RBP: ffffc900073d6b70 R08: ffffffff9077587f
R09: 1ffffffff20eeb0f
[   47.134749][    C1] R10: dffffc0000000000 R11: fffffbfff20eeb10
R12: dffffc0000000001
[   47.135480][    C1] R13: 0000000000000200 R14: ffffffff8f66d568
R15: ffffc900073d6ac0
[   47.136203][    C1]  ? __nbcon_atomic_flush_pending_con+0x25d/0x370
[   47.136808][    C1]  ? __pfx___nbcon_atomic_flush_pending_con+0x10/0x10
[   47.137439][    C1]  __nbcon_atomic_flush_pending+0x248/0x450
[   47.137991][    C1]  ? __pfx___nbcon_atomic_flush_pending+0x10/0x10
[   47.138591][    C1]  ? panic_on_this_cpu+0x32/0x40
[   47.139053][    C1]  vprintk_emit+0x1a6/0x5f0
[   47.139481][    C1]  ? __pfx_vprintk_emit+0x10/0x10
[   47.139950][    C1]  ? unwind_next_frame+0xa6/0x2550
[   47.140438][    C1]  _printk+0xdd/0x130
[   47.140816][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.141499][    C1]  ? __pfx__printk+0x10/0x10
[   47.141956][    C1]  ? unwind_next_frame+0xa6/0x2550
[   47.142471][    C1]  ? get_stack_info_noinstr+0x1b/0x130
[   47.142979][    C1]  ? wq_watchdog_touch+0x100/0x160
[   47.143464][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.144044][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.144623][    C1]  __show_trace_log_lvl+0x44d/0x550
[   47.145108][    C1]  ? debug_check_no_obj_freed+0x3a2/0x470
[   47.145640][    C1]  __warn+0x181/0x4c0
[   47.146015][    C1]  ? debug_print_object+0xec/0x230
[   47.146493][    C1]  ? debug_print_object+0xec/0x230
[   47.146972][    C1]  __report_bug+0x273/0x580
[   47.147402][    C1]  ? debug_print_object+0xec/0x230
[   47.147878][    C1]  ? __pfx___report_bug+0x10/0x10
[   47.148347][    C1]  ? ret_from_fork_asm+0x1a/0x30
[   47.148815][    C1]  report_bug_entry+0x19b/0x290
[   47.149270][    C1]  ? debug_print_object+0x18a/0x230
[   47.149757][    C1]  ? debug_print_object+0x18f/0x230
[   47.150240][    C1]  handle_bug+0xce/0x200
[   47.150645][    C1]  exc_invalid_op+0x1a/0x50
[   47.151142][    C1]  asm_exc_invalid_op+0x1a/0x20
[   47.151623][    C1] RIP: 0010:debug_print_object+0x18a/0x230
[   47.152195][    C1] Code: f8 48 c1 e8 03 80 3c 18 00 74 08 4c 89 ff
e8 dd 00 5d fd 4d 8b 0f 4c 89 ef 48 8b 74 24 08 48 89 ea 44 89 e1 4d
89 f0 ff 34 24 <67> 48 0f b9 3a 48 83 c4 08 ff 05 b3 e5 94 0b 48 83 c4
10 5b 41 5c
[   47.153971][    C1] RSP: 0000:ffffc900073d71b0 EFLAGS: 00010246
[   47.154538][    C1] RAX: 1ffffffff181f204 RBX: dffffc0000000000
RCX: 0000000000000000
[   47.155263][    C1] RDX: ffffffff8c6d6240 RSI: ffffffff8c6d5cc0
RDI: ffffffff908259e0
[   47.155993][    C1] RBP: ffffffff8c6d6240 R08: ffff8880232eb9d8
R09: ffffffff8c0fa380
[   47.156722][    C1] R10: dffffc0000000000 R11: ffffffff81b485d0
R12: 0000000000000000
[   47.157495][    C1] R13: ffffffff908259e0 R14: ffff8880232eb9d8
R15: ffffffff8c0f9020
[   47.158262][    C1]  ? __pfx_timer_debug_hint+0x10/0x10
[   47.158795][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.159374][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.159957][    C1]  debug_check_no_obj_freed+0x3a2/0x470
[   47.160476][    C1]  __free_frozen_pages+0x5ae/0xe20
[   47.160957][    C1]  ? __pfx_wiphy_dev_release+0x10/0x10
[   47.161576][    C1]  device_release+0xc4/0x1f0
[   47.162037][    C1]  kobject_put+0x228/0x560
[   47.162486][    C1]  ath9k_hif_usb_disconnect+0x135/0x240
[   47.163035][    C1]  usb_unbind_interface+0x26e/0x8f0
[   47.163527][    C1]  ? kernfs_remove_by_name_ns+0x101/0x140
[   47.164055][    C1]  ? __pfx_usb_unbind_interface+0x10/0x10
[   47.164589][    C1]  device_release_driver_internal+0x4d9/0x870
[   47.165154][    C1]  bus_remove_device+0x455/0x570
[   47.165623][    C1]  ? __pfx_bus_remove_device+0x10/0x10
[   47.166127][    C1]  ? kernfs_remove_by_name_ns+0x101/0x140
[   47.166661][    C1]  device_del+0x527/0x8f0
[   47.167070][    C1]  ? __pfx_device_del+0x10/0x10
[   47.167528][    C1]  ? kobject_put+0x51d/0x560
[   47.167963][    C1]  usb_disable_device+0x3d4/0x8d0
[   47.168439][    C1]  usb_disconnect+0x32f/0x990
[   47.168879][    C1]  hub_event+0x1cc9/0x4f30
[   47.169303][    C1]  ? __pfx_hub_event+0x10/0x10
[   47.169756][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.170284][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.170816][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.171453][    C1]  process_scheduled_works+0xc99/0x1900
[   47.172001][    C1]  ? __pfx_process_scheduled_works+0x10/0x10
[   47.172589][    C1]  ? assign_work+0x3d5/0x5e0
[   47.173021][    C1]  worker_thread+0xa53/0xfc0
[   47.173460][    C1]  kthread+0x38b/0x480
[   47.173844][    C1]  ? __pfx_worker_thread+0x10/0x10
[   47.174351][    C1]  ? __pfx_kthread+0x10/0x10
[   47.174810][    C1]  ret_from_fork+0x514/0xb70
[   47.175273][    C1]  ? __pfx_ret_from_fork+0x10/0x10
[   47.175784][    C1]  ? __switch_to+0xc68/0x1400
[   47.176224][    C1]  ? __pfx_kthread+0x10/0x10
[   47.176662][    C1]  ret_from_fork_asm+0x1a/0x30
[   47.177113][    C1]  </TASK>
[   47.177406][    C1]
[   47.177633][    C1] Allocated by task 10:
[   47.178018][    C1]  kasan_save_track+0x3f/0x90
[   47.178464][    C1]  __kasan_kmalloc+0x93/0xb0
[   47.178894][    C1]  __kmalloc_cache_noprof+0x320/0x610
[   47.179395][    C1]  ath9k_init_wmi+0x4f/0x2b0
[   47.179825][    C1]  ath9k_htc_probe_device+0x1e8/0x2340
[   47.180328][    C1]  ath9k_htc_hw_init+0x32/0x70
[   47.180774][    C1]  ath9k_hif_usb_firmware_cb+0x217/0x4b0
[   47.181394][    C1]  request_firmware_work_func+0x103/0x2e0
[   47.181952][    C1]  process_scheduled_works+0xc99/0x1900
[   47.182497][    C1]  worker_thread+0xa53/0xfc0
[   47.182928][    C1]  kthread+0x38b/0x480
[   47.183311][    C1]  ret_from_fork+0x514/0xb70
[   47.183747][    C1]  ret_from_fork_asm+0x1a/0x30
[   47.184194][    C1]
[   47.184422][    C1] Freed by task 5080:
[   47.184794][    C1]  kasan_save_track+0x3f/0x90
[   47.185234][    C1]  kasan_save_free_info+0x46/0x50
[   47.185708][    C1]  __kasan_slab_free+0x70/0x90
[   47.186156][    C1]  kfree+0x1c7/0x650
[   47.186527][    C1]  ath9k_htc_disconnect_device+0x205/0x270
[   47.187064][    C1]  ath9k_hif_usb_disconnect+0x135/0x240
[   47.187577][    C1]  usb_unbind_interface+0x26e/0x8f0
[   47.188062][    C1]  device_release_driver_internal+0x4d9/0x870
[   47.188627][    C1]  bus_remove_device+0x455/0x570
[   47.189086][    C1]  device_del+0x527/0x8f0
[   47.189493][    C1]  usb_disable_device+0x3d4/0x8d0
[   47.189960][    C1]  usb_disconnect+0x32f/0x990
[   47.190400][    C1]  hub_event+0x1cc9/0x4f30
[   47.190818][    C1]  process_scheduled_works+0xc99/0x1900
[   47.191428][    C1]  worker_thread+0xa53/0xfc0
[   47.191881][    C1]  kthread+0x38b/0x480
[   47.192282][    C1]  ret_from_fork+0x514/0xb70
[   47.192731][    C1]  ret_from_fork_asm+0x1a/0x30
[   47.193177][    C1]
[   47.193407][    C1] The buggy address belongs to the object at
ffff888023b88000
[   47.193407][    C1]  which belongs to the cache kmalloc-2k of size 2048
[   47.194668][    C1] The buggy address is located 448 bytes inside of
[   47.194668][    C1]  freed 2048-byte region [ffff888023b88000,
ffff888023b88800)
[   47.195918][    C1]
[   47.196143][    C1] The buggy address belongs to the physical page:
[   47.196738][    C1] page: refcount:0 mapcount:0
mapping:0000000000000000 index:0x0 pfn:0x23b88
[   47.197545][    C1] head: order:3 mapcount:0 entire_mapcount:0
nr_pages_mapped:0 pincount:0
[   47.198315][    C1] flags:
0xfff00000000040(head|node=0|zone=1|lastcpupid=0x7ff)
[   47.199011][    C1] page_type: f5(slab)
[   47.199389][    C1] raw: 00fff00000000040 ffff88801b042000
dead000000000100 dead000000000122
[   47.200168][    C1] raw: 0000000000000000 0000000000080008
00000000f5000000 0000000000000000
[   47.200951][    C1] head: 00fff00000000040 ffff88801b042000
dead000000000100 dead000000000122
[   47.201860][    C1] head: 0000000000000000 0000000000080008
00000000f5000000 0000000000000000
[   47.202691][    C1] head: 00fff00000000003 fffffffffffffe01
00000000ffffffff 00000000ffffffff
[   47.203484][    C1] head: ffffffffffffffff 0000000000000000
00000000ffffffff 0000000000000008
[   47.204268][    C1] page dumped because: kasan: bad access detected
[   47.204860][    C1] page_owner tracks the page as allocated
[   47.205386][    C1] page last allocated via order 3, migratetype
Unmovable, gfp_mask
0xd20c0(__GFP_IO|__GFP_FS|__GFP_NOWARN|__GFP_NORETRY|__GFP_COMP|__GFP_NOMEMALLOC),
pid 9342, tgid 9342 (dhcpcd), ts 33901338557
[   47.207091][    C1]  post_alloc_hook+0x1f9/0x250
[   47.207542][    C1]  prep_new_page+0x22/0xc0
[   47.207960][    C1]  get_page_from_freelist+0x240b/0x2450
[   47.208477][    C1]  __alloc_frozen_pages_noprof+0x211/0x450
[   47.209018][    C1]  allocate_slab+0x7d/0x5e0
[   47.209445][    C1]  refill_objects+0x2d6/0x350
[   47.209886][    C1]  __pcs_replace_empty_main+0x2c9/0x6c0
[   47.210400][    C1]  __kmalloc_node_track_caller_noprof+0x54d/0x720
[   47.210991][    C1]  __alloc_skb+0x2c5/0x7d0
[   47.211517][    C1]  rtmsg_ifinfo_build_skb+0x84/0x260
[   47.212033][    C1]  rtmsg_ifinfo+0x8c/0x1a0
[   47.212481][    C1]  register_netdevice+0x1ded/0x22a0
[   47.212967][    C1]  lapbeth_new_device+0x30c/0x570
[   47.213441][    C1]  lapbeth_device_event+0x329/0x460
[   47.213924][    C1]  notifier_call_chain+0x1ad/0x3d0
[   47.214403][    C1]  __dev_notify_flags+0x318/0x500
[   47.214872][    C1] page last free pid 11 tgid 11 ts 32751360683 stack trace:
[   47.215544][    C1]  free_pages_prepare+0xa03/0xb00
[   47.216012][    C1]  __free_contig_range_common+0x174/0x340
[   47.216539][    C1]  free_pages_bulk+0x48/0x120
[   47.216978][    C1]  vfree+0x22c/0x470
[   47.217345][    C1]  delayed_vfree_work+0x55/0x80
[   47.217801][    C1]  process_scheduled_works+0xc99/0x1900
[   47.218315][    C1]  worker_thread+0xa53/0xfc0
[   47.218750][    C1]  kthread+0x38b/0x480
[   47.219134][    C1]  ret_from_fork+0x514/0xb70
[   47.219570][    C1]  ret_from_fork_asm+0x1a/0x30
[   47.220019][    C1]
[   47.220244][    C1] Memory state around the buggy address:
[   47.220765][    C1]  ffff888023b88080: fb fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[   47.221609][    C1]  ffff888023b88100: fb fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[   47.222390][    C1] >ffff888023b88180: fb fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[   47.223118][    C1]                                            ^
[   47.223687][    C1]  ffff888023b88200: fb fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[   47.224418][    C1]  ffff888023b88280: fb fb fb fb fb fb fb fb fb
fb fb fb fb fb fb fb
[   47.225150][    C1]
==================================================================
[   47.225920][    C1] Kernel panic - not syncing: KASAN: panic_on_warn set ...
[   47.226593][    C1] CPU: 1 UID: 0 PID: 5080 Comm: kworker/1:3 Not
tainted 7.4.0-rc3-00406-g65e4fd942f72 #1 PREEMPT(full)
[   47.227865][    C1] Hardware name: QEMU Standard PC (Q35 + ICH9,
2009), BIOS 1.17.0-debian-1.17.0-1ubuntu1 04/01/2014
[   47.228884][    C1] Workqueue: usb_hub_wq hub_event
[   47.229379][    C1] Call Trace:
[   47.229712][    C1]  <IRQ>
[   47.229995][    C1]  vpanic+0x26f/0x710
[   47.230396][    C1]  panic+0xc5/0xd0
[   47.230768][    C1]  ? __pfx_panic+0x10/0x10
[   47.231246][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.231713][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.232173][    C1]  check_panic_on_warn+0x89/0xb0
[   47.232667][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.233125][    C1]  end_report+0x73/0x170
[   47.233546][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.234008][    C1]  kasan_report+0x128/0x150
[   47.234456][    C1]  ? _raw_spin_lock+0x2e/0x40
[   47.234923][    C1]  __kasan_check_byte+0x2a/0x40
[   47.235402][    C1]  lock_acquire+0x7d/0x350
[   47.235844][    C1]  ? lock_acquire+0x115/0x350
[   47.236309][    C1]  _raw_spin_lock+0x2e/0x40
[   47.236760][    C1]  ? ath9k_htc_tx_cleanup_timer+0x57/0x4d0
[   47.237328][    C1]  ath9k_htc_tx_cleanup_timer+0x57/0x4d0
[   47.237880][    C1]  call_timer_fn+0x18d/0x5f0
[   47.238337][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.238948][    C1]  ? call_timer_fn+0xd5/0x5f0
[   47.239412][    C1]  ? __pfx_call_timer_fn+0x10/0x10
[   47.239912][    C1]  ? _raw_spin_unlock_irq+0x23/0x50
[   47.240423][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.241053][    C1]  __run_timer_base+0x652/0x8b0
[   47.241534][    C1]  ? lock_acquire+0x115/0x350
[   47.242002][    C1]  ? __pfx___run_timer_base+0x10/0x10
[   47.242558][    C1]  run_timer_softirq+0xb7/0x170
[   47.243037][    C1]  handle_softirqs+0x26a/0x8d0
[   47.243516][    C1]  __irq_exit_rcu+0xc6/0x220
[   47.243973][    C1]  irq_exit_rcu+0x9/0x30
[   47.244373][    C1]  sysvec_apic_timer_interrupt+0xa6/0xc0
[   47.244897][    C1]  </IRQ>
[   47.245174][    C1]  <TASK>
[   47.245461][    C1]  asm_sysvec_apic_timer_interrupt+0x1a/0x20
[   47.246014][    C1] RIP: 0010:__nbcon_atomic_flush_pending_con+0x261/0x370
[   47.246663][    C1] Code: 00 02 00 00 75 41 e8 1e 1f 21 00 4d 85 ed
4c 8d 7c 24 40 75 0c e8 0f 1f 21 00 45 84 e4 75 0d eb 3b e8 03 1f 21
00 fb 45 84 e4 <74> 30 f6 44 24 50 02 49 bc 00 00 00 00 00 fc ff df 74
34 e8 e7 1e
[   47.248412][    C1] RSP: 0000:ffffc900073d6a80 EFLAGS: 00000202
[   47.248973][    C1] RAX: ffffffff81a7a58d RBX: 0000000000000949
RCX: ffff8881072b2640
[   47.249702][    C1] RDX: 0000000000000000 RSI: 0000000000000000
RDI: 0000000000000000
[   47.250430][    C1] RBP: ffffc900073d6b70 R08: ffffffff9077587f
R09: 1ffffffff20eeb0f
[   47.251245][    C1] R10: dffffc0000000000 R11: fffffbfff20eeb10
R12: dffffc0000000001
[   47.252010][    C1] R13: 0000000000000200 R14: ffffffff8f66d568
R15: ffffc900073d6ac0
[   47.252767][    C1]  ? __nbcon_atomic_flush_pending_con+0x25d/0x370
[   47.253363][    C1]  ? __pfx___nbcon_atomic_flush_pending_con+0x10/0x10
[   47.253989][    C1]  __nbcon_atomic_flush_pending+0x248/0x450
[   47.254544][    C1]  ? __pfx___nbcon_atomic_flush_pending+0x10/0x10
[   47.255138][    C1]  ? panic_on_this_cpu+0x32/0x40
[   47.255604][    C1]  vprintk_emit+0x1a6/0x5f0
[   47.256028][    C1]  ? __pfx_vprintk_emit+0x10/0x10
[   47.256497][    C1]  ? unwind_next_frame+0xa6/0x2550
[   47.256975][    C1]  _printk+0xdd/0x130
[   47.257355][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.257974][    C1]  ? __pfx__printk+0x10/0x10
[   47.258433][    C1]  ? unwind_next_frame+0xa6/0x2550
[   47.258939][    C1]  ? get_stack_info_noinstr+0x1b/0x130
[   47.259450][    C1]  ? wq_watchdog_touch+0x100/0x160
[   47.259926][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.260505][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.261167][    C1]  __show_trace_log_lvl+0x44d/0x550
[   47.261681][    C1]  ? debug_check_no_obj_freed+0x3a2/0x470
[   47.262235][    C1]  __warn+0x181/0x4c0
[   47.262628][    C1]  ? debug_print_object+0xec/0x230
[   47.263103][    C1]  ? debug_print_object+0xec/0x230
[   47.263581][    C1]  __report_bug+0x273/0x580
[   47.264006][    C1]  ? debug_print_object+0xec/0x230
[   47.264484][    C1]  ? __pfx___report_bug+0x10/0x10
[   47.264950][    C1]  ? ret_from_fork_asm+0x1a/0x30
[   47.265418][    C1]  report_bug_entry+0x19b/0x290
[   47.265873][    C1]  ? debug_print_object+0x18a/0x230
[   47.266354][    C1]  ? debug_print_object+0x18f/0x230
[   47.266839][    C1]  handle_bug+0xce/0x200
[   47.267238][    C1]  exc_invalid_op+0x1a/0x50
[   47.267669][    C1]  asm_exc_invalid_op+0x1a/0x20
[   47.268121][    C1] RIP: 0010:debug_print_object+0x18a/0x230
[   47.268663][    C1] Code: f8 48 c1 e8 03 80 3c 18 00 74 08 4c 89 ff
e8 dd 00 5d fd 4d 8b 0f 4c 89 ef 48 8b 74 24 08 48 89 ea 44 89 e1 4d
89 f0 ff 34 24 <67> 48 0f b9 3a 48 83 c4 08 ff 05 b3 e5 94 0b 48 83 c4
10 5b 41 5c
[   47.270409][    C1] RSP: 0000:ffffc900073d71b0 EFLAGS: 00010246
[   47.270969][    C1] RAX: 1ffffffff181f204 RBX: dffffc0000000000
RCX: 0000000000000000
[   47.271807][    C1] RDX: ffffffff8c6d6240 RSI: ffffffff8c6d5cc0
RDI: ffffffff908259e0
[   47.272569][    C1] RBP: ffffffff8c6d6240 R08: ffff8880232eb9d8
R09: ffffffff8c0fa380
[   47.273292][    C1] R10: dffffc0000000000 R11: ffffffff81b485d0
R12: 0000000000000000
[   47.274018][    C1] R13: ffffffff908259e0 R14: ffff8880232eb9d8
R15: ffffffff8c0f9020
[   47.274744][    C1]  ? __pfx_timer_debug_hint+0x10/0x10
[   47.275242][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.275821][    C1]  ? __pfx_ath9k_htc_tx_cleanup_timer+0x10/0x10
[   47.276400][    C1]  debug_check_no_obj_freed+0x3a2/0x470
[   47.276913][    C1]  __free_frozen_pages+0x5ae/0xe20
[   47.277394][    C1]  ? __pfx_wiphy_dev_release+0x10/0x10
[   47.277901][    C1]  device_release+0xc4/0x1f0
[   47.278334][    C1]  kobject_put+0x228/0x560
[   47.278757][    C1]  ath9k_hif_usb_disconnect+0x135/0x240
[   47.279268][    C1]  usb_unbind_interface+0x26e/0x8f0
[   47.279760][    C1]  ? kernfs_remove_by_name_ns+0x101/0x140
[   47.280289][    C1]  ? __pfx_usb_unbind_interface+0x10/0x10
[   47.280822][    C1]  device_release_driver_internal+0x4d9/0x870
[   47.281495][    C1]  bus_remove_device+0x455/0x570
[   47.281980][    C1]  ? __pfx_bus_remove_device+0x10/0x10
[   47.282519][    C1]  ? kernfs_remove_by_name_ns+0x101/0x140
[   47.283046][    C1]  device_del+0x527/0x8f0
[   47.283458][    C1]  ? __pfx_device_del+0x10/0x10
[   47.283912][    C1]  ? kobject_put+0x51d/0x560
[   47.284345][    C1]  usb_disable_device+0x3d4/0x8d0
[   47.284819][    C1]  usb_disconnect+0x32f/0x990
[   47.285258][    C1]  hub_event+0x1cc9/0x4f30
[   47.285686][    C1]  ? __pfx_hub_event+0x10/0x10
[   47.286133][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.286662][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.287187][    C1]  ? process_scheduled_works+0x94e/0x1900
[   47.287715][    C1]  process_scheduled_works+0xc99/0x1900
[   47.288228][    C1]  ? __pfx_process_scheduled_works+0x10/0x10
[   47.288783][    C1]  ? assign_work+0x3d5/0x5e0
[   47.289215][    C1]  worker_thread+0xa53/0xfc0
[   47.289654][    C1]  kthread+0x38b/0x480
[   47.290037][    C1]  ? __pfx_worker_thread+0x10/0x10
[   47.290518][    C1]  ? __pfx_kthread+0x10/0x10
[   47.290950][    C1]  ret_from_fork+0x514/0xb70
[   47.291485][    C1]  ? __pfx_ret_from_fork+0x10/0x10
[   47.291985][    C1]  ? __switch_to+0xc68/0x1400
[   47.292454][    C1]  ? __pfx_kthread+0x10/0x10
[   47.292888][    C1]  ret_from_fork_asm+0x1a/0x30
[   47.293338][    C1]  </TASK>
[   47.293884][    C1] Kernel Offset: disabled
[   47.294448][    C1] Rebooting in 86400 seconds..

Thanks!

On Mon, Nov 9, 2026 at 3:35 AM Chad Aldreda <ca@modelmiser.com> wrote:
>
> Hi Farhad,
>
> Could you share the reproducer for this one?
>
> Two paths in the code would fit the report. Both end the same way:
> the timer re-arms itself (ath9k_htc_tx_cleanup_timer()), and nothing
> deletes it before ath9k_htc_disconnect_device() frees the hw.
>
> 1. ath9k_fatal_work() calls ath9k_htc_reset(), which re-arms
>    tx.cleanup_timer without checking ATH_OP_INVALID. A WMI_FATAL_EVENTID
>    (or beacon-stuck SWBA) that arrives after ath9k_htc_stop() has
>    finished still queues fatal_work, since WMI events are processed
>    until ath9k_stop_wmi(). The timer is then armed on a stopped device,
>    and ieee80211_unregister_hw() does not call stop again.
>
> 2. Inside ath9k_htc_stop(), the timer is deleted and priv->mutex is
>    dropped before cancel_work_sync(&priv->fatal_work). A fatal_work
>    already waiting on the mutex runs the reset in that gap and re-arms
>    the timer.
>
> I'd like to know which one your reproducer hits before proposing a
> fix. Does it send WMI_FATAL_EVENTID (or let beacons go stuck in
> AP/IBSS/mesh mode), and is the interface up or down when it does?
>
> The code reading above was done with an AI assistant (Claude). Nothing
> has been tested yet.
>
> Thanks,
> Chad
>

[-- Attachment #2: reproducer.c --]
[-- Type: application/octet-stream, Size: 8024 bytes --]

#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <linux/usb/ch9.h>
#include <linux/usb/raw_gadget.h>
#include <pthread.h>
#include <stdio.h>
#include <string.h>
#include <sys/ioctl.h>
#include <sys/wait.h>
#include <unistd.h>

#define WMI_TARGET_IC_UPDATE_CMDID 0x0018
#define ATH9K_FIRMWARE_DOWNLOAD_COMP 0x31

static const unsigned char device_descriptor[] = {
    0x12, 0x01, 0x00, 0x02, 0xff, 0xff, 0xff, 0x40, 0xf3, 0x0c, 0x71, 0x92,
    0x08, 0x01, 0x01, 0x02, 0x03, 0x01};
static const unsigned char config_descriptor[] = {
    0x09, 0x02, 0x48, 0x00, 0x01, 0x01, 0x00, 0x80, 0xfa,
    0x09, 0x04, 0x00, 0x00, 0x06, 0xff, 0x00, 0x00, 0x00,
    0x09, 0x05, 0x01, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
    0x09, 0x05, 0x82, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
    0x09, 0x05, 0x83, 0x03, 0x40, 0x00, 0x01, 0x00, 0x00,
    0x09, 0x05, 0x04, 0x03, 0x40, 0x00, 0x01, 0x00, 0x00,
    0x09, 0x05, 0x05, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00,
    0x09, 0x05, 0x06, 0x02, 0x00, 0x02, 0x00, 0x00, 0x00};
static const unsigned char language_id_string[] = {4, USB_DT_STRING, 0x09, 0x04};
static const unsigned char syz_string[] = {8, USB_DT_STRING, 's', 0, 'y', 0, 'z', 0};

struct endpoint_io {
  struct usb_raw_ep_io header;
  unsigned char data[4096];
};

static int raw_gadget_fd;
static int register_out_handle, register_in_handle;

static void put_be32(unsigned char* destination, unsigned int value)
{
  destination[0] = value >> 24;
  destination[1] = value >> 16;
  destination[2] = value >> 8;
  destination[3] = value;
}

static void send_on_register_in(const void* frame, unsigned int length)
{
  struct endpoint_io reply = {.header = {.ep = register_in_handle, .length = length}};
  memcpy(reply.data, frame, length);
  ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP_WRITE, &reply);
}

static void enumerate_and_load_firmware(void)
{
  struct usb_raw_init init = {.driver_name = "dummy_udc",
                              .device_name = "dummy_udc.0",
                              .speed = USB_SPEED_HIGH};
  int firmware_download_done = 0;
  raw_gadget_fd = open("/dev/raw-gadget", O_RDWR);
  ioctl(raw_gadget_fd, USB_RAW_IOCTL_INIT, &init);
  ioctl(raw_gadget_fd, USB_RAW_IOCTL_RUN, 0);
  while (!firmware_download_done) {
    struct {
      struct usb_raw_event header;
      struct usb_ctrlrequest request;
    } event = {.header = {.length = sizeof(struct usb_ctrlrequest)}};
    struct endpoint_io response = {0};
    const void* in_data = NULL;
    unsigned int in_length = 0;
    ioctl(raw_gadget_fd, USB_RAW_IOCTL_EVENT_FETCH, &event);
    if (event.header.type != USB_RAW_EVENT_CONTROL)
      continue;
    if (event.request.bRequestType & USB_DIR_IN) {
      unsigned int descriptor_type = event.request.wValue >> 8;
      unsigned int string_index = event.request.wValue & 0xff;
      if (descriptor_type == USB_DT_DEVICE)
        in_data = device_descriptor, in_length = sizeof(device_descriptor);
      else if (descriptor_type == USB_DT_CONFIG)
        in_data = config_descriptor, in_length = sizeof(config_descriptor);
      else if (descriptor_type == USB_DT_STRING && string_index == 0)
        in_data = language_id_string, in_length = sizeof(language_id_string);
      else if (descriptor_type == USB_DT_STRING)
        in_data = syz_string, in_length = sizeof(syz_string);
      else {
        ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP0_STALL, 0);
        continue;
      }
      if (in_length > event.request.wLength)
        in_length = event.request.wLength;
      response.header.length = in_length;
      memcpy(response.data, in_data, in_length);
      ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP0_WRITE, &response);
      continue;
    }
    if (event.request.bRequest == USB_REQ_SET_CONFIGURATION &&
        (event.request.bRequestType & USB_TYPE_MASK) == USB_TYPE_STANDARD) {
      ioctl(raw_gadget_fd, USB_RAW_IOCTL_VBUS_DRAW, config_descriptor[8]);
      ioctl(raw_gadget_fd, USB_RAW_IOCTL_CONFIGURE, 0);
      for (int offset = 18; offset < sizeof(config_descriptor); offset += 9) {
        int handle = ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP_ENABLE,
                           &config_descriptor[offset]);
        if (config_descriptor[offset + 2] == 0x04)
          register_out_handle = handle;
        if (config_descriptor[offset + 2] == 0x83)
          register_in_handle = handle;
      }
    }
    if (event.request.bRequest == ATH9K_FIRMWARE_DOWNLOAD_COMP)
      firmware_download_done = 1;
    response.header.length = event.request.wLength;
    ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP0_READ, &response);
  }
  usleep(200 * 1000);
}

static void* answer_wmi_commands(void* unused)
{
  static const unsigned char htc_connect_service_response[] = {
      0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00,
      0x03, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00};
  for (;;) {
    struct endpoint_io command = {.header = {.ep = register_out_handle, .length = 1024}};
    unsigned char reply[44] = {0};
    unsigned int wmi_command_id, first_register;
    if (ioctl(raw_gadget_fd, USB_RAW_IOCTL_EP_READ, &command) < 12)
      continue;
    if (command.data[0] == 0) {
      send_on_register_in(htc_connect_service_response,
                           sizeof(htc_connect_service_response));
      continue;
    }
    wmi_command_id = command.data[8] << 8 | command.data[9];
    if (wmi_command_id == WMI_TARGET_IC_UPDATE_CMDID)
      continue;
    reply[0] = command.data[0];
    reply[3] = sizeof(reply) - 8;
    memcpy(reply + 8, command.data + 8, 4);
    first_register = command.data[12] << 24 | command.data[13] << 16 |
                     command.data[14] << 8 | command.data[15];
    if (wmi_command_id == 0x0003) {
      put_be32(reply + 12, 0x00010004);
    } else if (first_register == 0x2400) {
      put_be32(reply + 12, 0x00000012);
      put_be32(reply + 16, 0x0000688a);
      put_be32(reply + 20, 0x0000e001);
      put_be32(reply + 24, 0x00000002);
      put_be32(reply + 36, 0x00001102);
      put_be32(reply + 40, 0x00003322);
    } else if (first_register == 0x2420) {
      put_be32(reply + 12, 0x00005544);
      put_be32(reply + 16, 0x00000001);
    } else {
      unsigned int register_value = 0xc0;
      if (first_register == 0x407c)
        register_value = 0xa55a;
      else if (first_register == 0x7044)
        register_value = 2;
      else if ((first_register & 0xfffff000) == 0x2000)
        register_value = 0;
      for (int word = 0; word < 8; word++)
        put_be32(reply + 12 + 4 * word, register_value);
    }
    send_on_register_in(reply, sizeof(reply));
  }
  return unused;
}

static void bring_up_ath9k_netdev(void)
{
  for (int attempt = 0; attempt < 600; attempt++, usleep(25 * 1000)) {
    DIR* net_class = opendir("/sys/class/net");
    struct dirent* netdev;
    while ((netdev = readdir(net_class))) {
      char path[512], driver_link[256] = {0};
      snprintf(path, sizeof(path), "/sys/class/net/%s/device/driver", netdev->d_name);
      if (readlink(path, driver_link, sizeof(driver_link) - 1) > 0 &&
          strstr(driver_link, "/ath9k_htc"))
        break;
    }
    if (!netdev) {
      closedir(net_class);
      continue;
    }
    char flags_path[512];
    snprintf(flags_path, sizeof(flags_path), "/sys/class/net/%s/flags", netdev->d_name);
    closedir(net_class);
    int flags_fd = open(flags_path, O_WRONLY);
    int write_result = write(flags_fd, "0x1003", 6);
    close(flags_fd);
    if (write_result < 0 && errno == ETIMEDOUT)
      return;
  }
}

static void plug_bring_up_and_unplug(void)
{
  static const unsigned char htc_ready_frame[] = {
      0x00, 0x00, 0x00, 0x08, 0x00, 0x40, 0x00, 0x00,
      0x00, 0x01, 0x00, 0x21, 0x00, 0x40, 0x08, 0x00};
  pthread_t wmi_responder;
  enumerate_and_load_firmware();
  pthread_create(&wmi_responder, NULL, answer_wmi_commands, NULL);
  send_on_register_in(htc_ready_frame, sizeof(htc_ready_frame));
  bring_up_ath9k_netdev();
}

int main(void)
{
  if (fork() == 0) {
    plug_bring_up_and_unplug();
    _exit(0);
  }
  wait(NULL);
  sleep(5);
  return 0;
}

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug
  2026-11-20 17:21   ` Farhad Alemi
@ 2026-11-20 18:26     ` Chad Aldreda
  0 siblings, 0 replies; 4+ messages in thread
From: Chad Aldreda @ 2026-11-20 18:26 UTC (permalink / raw)
  To: Farhad Alemi
  Cc: Toke Høiland-Jørgensen, Jeff Johnson,
	Mikołaj Pisula, falemi, linux-wireless, linux-kernel

Hi Farhad,

Thanks for the reproducer. It hits neither of the two paths I guessed
at. It withholds the reply to WMI_TARGET_IC_UPDATE_CMDID, so
ath9k_htc_update_cap_target() times out in ath9k_htc_start(), which
logs that only at debug level, still arms tx.cleanup_timer, and returns
the error. mac80211 treats the start as failed and never calls
ath9k_htc_stop(), so the timer is still pending when the device is
unplugged, and then fires on the freed hw (the KASAN report).

Mikołaj Pisula found the same thing and posted a fix this week, which
Toke has applied to ath9k-pending:

https://lore.kernel.org/linux-wireless/20261117103918.33701-1-mikolaj@pisu.la/
https://git.kernel.org/toke/ath9k-pending/c/176a947f3d98

I haven't run your reproducer against it. If you do, a Tested-by on
that thread would still be welcome.

Chad

This reply was drafted with an AI assistant (Claude Opus 5.5).


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-20 18:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-28  5:25 [BUG] ath9k_htc_tx_cleanup_timer -- ODEBUG free-active-timer and use-after-free on USB unplug Farhad Alemi
2026-11-09 10:34 ` Chad Aldreda
2026-11-20 17:21   ` Farhad Alemi
2026-11-20 18:26     ` Chad Aldreda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.