All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/2] Bluetooth: 6lowpan: fix netdev teardown UAF and registration rollback GPF
@ 2026-11-30 10:28 Bin Luo (University of Electronic Science and Technology of China)
  2026-11-30 10:28 ` [PATCH 1/2] Bluetooth: 6lowpan: publish netdev after registration in setup_netdev() Bin Luo (University of Electronic Science and Technology of China)
  2026-11-30 10:28 ` [PATCH 2/2] Bluetooth: 6lowpan: unlink closing device and protect RCU lookups Bin Luo (University of Electronic Science and Technology of China)
  0 siblings, 2 replies; 4+ messages in thread
From: Bin Luo (University of Electronic Science and Technology of China) @ 2026-11-30 10:28 UTC (permalink / raw)
  To: marcel, luiz.dentz; +Cc: linux-bluetooth, linux-kernel

This 2-patch series fixes two lifetime bugs in Bluetooth 6LoWPAN
(net/bluetooth/6lowpan.c) discovered by static call-chain audit and
reproduced live under QEMU (x86_64, KASAN + LOCKDEP, 4 vCPUs) using only
mainline hci_vhci (/dev/vhci) with zero kernel modifications:

1. Patch 1 fixes a double list_del_rcu() general protection fault in
   setup_netdev(): publishing (*dev)->list on bt_6lowpan_devices before
   lowpan_register_netdev() causes device_event(NETDEV_UNREGISTER) to
   unlink the entry on rollback (for example after an addrconf_notify /
   snmp6_register_dev failure), after which setup_netdev()'s error path
   calls list_del_rcu() a second time and faults on LIST_POISON2
   (0xdead000000000122).

2. Patch 2 fixes a slab-use-after-free write in __run_timer_base() when
   the last L2CAP IPSP peer disconnects concurrently with a new channel
   becoming ready on the same hci_dev, as well as unprotected RCU
   lookups in lookup_dev() callers (chan_ready_cb, chan_recv_cb,
   chan_suspend_cb, chan_resume_cb):

   BUG: KASAN: slab-use-after-free in __run_timer_base.part.0+0x897/0x940
   Write of size 8 at addr ffff8880046ed0e8 by task swapper/0/0
   Allocated by task 92:
    alloc_netdev_mqs+0x78/0x10c0
    chan_ready_cb+0x3cf/0xab0
   Freed by task 9:
    kfree+0x2fd/0x530
    device_release+0xc8/0x240
    kobject_put+0x14d/0x280
    netdev_run_todo+0x7a7/0x10f0
    delete_netdev+0x5b/0x80

Verification:
- scripts/checkpatch.pl --strict: 0 errors, 0 warnings, 0 checks on both patches
- W=1 KASAN+LOCKDEP build of net/bluetooth/6lowpan.o: 0 warnings, 0 errors
- QEMU KASAN+LOCKDEP hci_vhci reproducer (12 rapid connect/disconnect cycles):
  - Unpatched v7.4-rc5: KASAN slab-use-after-free write on iteration 0,
    followed by double list_del_rcu() GPF on iteration 4
  - With this series: 12/12 iterations pass with 0 KASAN, 0 GPF, 0 Lockdep,
    and 0 warnings

base-commit: 4dce97c6c265544342e716e62fd24bbb232590c5

Bin Luo (University of Electronic Science and Technology of China) (2):
  Bluetooth: 6lowpan: publish netdev after registration in
    setup_netdev()
  Bluetooth: 6lowpan: unlink closing device and protect RCU lookups

 net/bluetooth/6lowpan.c | 142 +++++++++++++++++++++++++++-------------
 1 file changed, 95 insertions(+), 47 deletions(-)

-- 
2.51.0.windows.1


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

end of thread, other threads:[~2026-11-30 16:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-30 10:28 [PATCH 0/2] Bluetooth: 6lowpan: fix netdev teardown UAF and registration rollback GPF Bin Luo (University of Electronic Science and Technology of China)
2026-11-30 10:28 ` [PATCH 1/2] Bluetooth: 6lowpan: publish netdev after registration in setup_netdev() Bin Luo (University of Electronic Science and Technology of China)
2026-11-30 16:33   ` Bluetooth: 6lowpan: fix netdev teardown UAF and registration rollback GPF bluez.test.bot
2026-11-30 10:28 ` [PATCH 2/2] Bluetooth: 6lowpan: unlink closing device and protect RCU lookups Bin Luo (University of Electronic Science and Technology of China)

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.