CVE-2022-49910: Bluetooth: L2CAP: Fix use-after-free caused by l2cap_reassemble_sdu

Published May 1, 2025
·
Updated

In the Linux kernel, the following vulnerability has been resolved:

Bluetooth: L2CAP: Fix use-after-free caused by l2capreassemblesdu

Fix the race condition between the following two flows that run in parallel:

1. l2capreassemblesdu -> chan->ops->recv (l2capsockrecvcb) -> sockqueuercvskb.

2. btsockrecvmsg -> skbrecvdatagram, skbfreedatagram.

An SKB can be queued by the first flow and immediately dequeued and freed by the second flow, therefore the callers of l2capreassemblesdu can't use the SKB after that function returns. However, some places continue accessing struct l2capctrl that resides in the SKB's CB for a short time after l2capreassemblesdu returns, leading to a use-after-free condition (the stack trace is below, line numbers for kernel 5.19.8).

Fix it by keeping a local copy of struct l2capctrl.

BUG: KASAN: use-after-free in l2caprxstaterecv (net/bluetooth/l2capcore.c:6906) bluetooth Read of size 1 at addr ffff88812025f2f0 by task kworker/u17:3/43169

Workqueue: hci0 hcirxwork [bluetooth] Call Trace: <TASK> dumpstacklvl (lib/dumpstack.c:107 (discriminator 4)) printreport.cold (mm/kasan/report.c:314 mm/kasan/report.c:429) ? l2caprxstaterecv (net/bluetooth/l2capcore.c:6906) bluetooth kasanreport (mm/kasan/report.c:162 mm/kasan/report.c:493) ? l2caprxstaterecv (net/bluetooth/l2capcore.c:6906) bluetooth l2caprxstaterecv (net/bluetooth/l2capcore.c:6906) bluetooth l2caprx (net/bluetooth/l2capcore.c:7236 net/bluetooth/l2capcore.c:7271) bluetooth retfromfork (arch/x86/entry/entry64.S:306) </TASK>

Allocated by task 43169: kasansavestack (mm/kasan/common.c:39) kasanslaballoc (mm/kasan/common.c:45 mm/kasan/common.c:436 mm/kasan/common.c:469) kmemcacheallocnode (mm/slab.h:750 mm/slub.c:3243 mm/slub.c:3293) allocskb (net/core/skbuff.c:414) l2caprecvfrag (./include/net/bluetooth/bluetooth.h:425 net/bluetooth/l2capcore.c:8329) bluetooth l2caprecvacldata (net/bluetooth/l2capcore.c:8442) bluetooth hcirxwork (net/bluetooth/hcicore.c:3642 net/bluetooth/hcicore.c:3832) bluetooth processonework (kernel/workqueue.c:2289) workerthread (./include/linux/list.h:292 kernel/workqueue.c:2437) kthread (kernel/kthread.c:376) retfromfork (arch/x86/entry/entry64.S:306)

Freed by task 27920: kasansavestack (mm/kasan/common.c:39) kasansettrack (mm/kasan/common.c:45) kasansetfreeinfo (mm/kasan/generic.c:372) kasanslabfree (mm/kasan/common.c:368 mm/kasan/common.c:328) slabfreefreelisthook (mm/slub.c:1780) kmemcachefree (mm/slub.c:3536 mm/slub.c:3553) skbfreedatagram (./include/net/sock.h:1578 ./include/net/sock.h:1639 net/core/datagram.c:323) btsockrecvmsg (net/bluetooth/afbluetooth.c:295) bluetooth l2capsockrecvmsg (net/bluetooth/l2capsock.c:1212) bluetooth sockreaditer (net/socket.c:1087) newsyncread (./include/linux/fs.h:2052 fs/readwrite.c:401) vfsread (fs/readwrite.c:482) ksysread (fs/readwrite.c:620) dosyscall64 (arch/x86/entry/common.c:50 arch/x86/entry/common.c:80) entrySYSCALL64afterhwframe (arch/x86/entry/entry64.S:120)

Affected Software

11 affected components
Linux Linux kernel>=5.19.8
Linux Linux kernel>=3.6<4.9.333
Linux Linux kernel>=4.10<4.14.299
Linux Linux kernel>=4.15<4.19.265
Linux Linux kernel>=4.20<5.4.224
Linux Linux kernel>=5.5<5.10.154
Linux Linux kernel>=5.11<5.15.78
Linux Linux kernel>=5.16<6.0.8
Linux Linux kernel=6.1-rc1
Linux Linux kernel=6.1-rc2
Linux Linux kernel=6.1-rc3

Event History

May 1, 2025
CVE Published
via MITRE·02:10 PM
Data Sourced
via MITRE·02:10 PM
DescriptionSeverity
Data Sourced
via NVD·03:16 PM
RemedyDescriptionSeverityWeaknessAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2022-49910?

CVE-2022-49910 has been classified as a high-severity vulnerability due to its potential for exploitation in Bluetooth communications.

2

How do I fix CVE-2022-49910?

To fix CVE-2022-49910, update your Linux kernel to the latest patched version that includes the fix for this vulnerability.

3

What systems are affected by CVE-2022-49910?

CVE-2022-49910 affects all versions of the Linux Kernel that utilize Bluetooth L2CAP functionality.

4

What type of vulnerability is CVE-2022-49910?

CVE-2022-49910 is a use-after-free vulnerability that can lead to race conditions in Bluetooth L2CAP handling.

5

Can CVE-2022-49910 be exploited remotely?

Yes, CVE-2022-49910 can potentially be exploited remotely by an attacker who can establish a Bluetooth connection.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203