CVE-2022-49908: Bluetooth: L2CAP: Fix memory leak in vhci_write
In the Linux kernel, the following vulnerability has been resolved:
Bluetooth: L2CAP: Fix memory leak in vhciwrite
Syzkaller reports a memory leak as follows: ==================================== BUG: memory leak unreferenced object 0xffff88810d81ac00 (size 240): [...] hex dump (first 32 bytes): 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ backtrace: [<ffffffff838733d9>] allocskb+0x1f9/0x270 net/core/skbuff.c:418 [<ffffffff833f742f>] allocskb include/linux/skbuff.h:1257 [inline] [<ffffffff833f742f>] btskballoc include/net/bluetooth/bluetooth.h:469 [inline] [<ffffffff833f742f>] vhcigetuser drivers/bluetooth/hcivhci.c:391 [inline] [<ffffffff833f742f>] vhciwrite+0x5f/0x230 drivers/bluetooth/hcivhci.c:511 [<ffffffff815e398d>] callwriteiter include/linux/fs.h:2192 [inline] [<ffffffff815e398d>] newsyncwrite fs/readwrite.c:491 [inline] [<ffffffff815e398d>] vfswrite+0x42d/0x540 fs/readwrite.c:578 [<ffffffff815e3cdd>] ksyswrite+0x9d/0x160 fs/readwrite.c:631 [<ffffffff845e0645>] dosyscallx64 arch/x86/entry/common.c:50 [inline] [<ffffffff845e0645>] dosyscall64+0x35/0xb0 arch/x86/entry/common.c:80 [<ffffffff84600087>] entrySYSCALL64afterhwframe+0x63/0xcd ====================================
HCI core will uses hcirxwork() to process frame, which is queued to the hdev->rxq tail in hcirecvframe() by HCI driver.
Yet the problem is that, HCI core may not free the skb after handling ACL data packets. To be more specific, when start fragment does not contain the L2CAP length, HCI core just copies skb into conn->rxskb and finishes frame process in l2caprecvacldata(), without freeing the skb, which triggers the above memory leak.
This patch solves it by releasing the relative skb, after processing the above case in l2caprecvacldata().
Affected Software
Remediation
Event History
Frequently Asked Questions
What is the severity of CVE-2022-49908?
CVE-2022-49908 is classified as a memory leak vulnerability in the Linux kernel's Bluetooth L2CAP implementation.
How do I fix CVE-2022-49908?
To fix CVE-2022-49908, update your Linux kernel to the latest version where the vulnerability has been patched.
What systems are affected by CVE-2022-49908?
CVE-2022-49908 affects systems running vulnerable versions of the Linux kernel that include the Bluetooth L2CAP functionality.
Can CVE-2022-49908 cause a system crash?
While CVE-2022-49908 primarily leads to memory leaks, it may indirectly affect system stability if left unaddressed.
Is there any known exploit for CVE-2022-49908?
As of now, there are no publicly known exploits specifically targeting CVE-2022-49908.