Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1280F1F03D9 for ; Thu, 1 May 2025 14:18:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109094; cv=none; b=dKrF2YgI7JbBoOa5/NItFf4VDUStULsvY/eT6nBBsOVeviHdcBBD4bPOdj/jseZe3rYg7Fa2q8huIClAXnDKqpF/MzttDn273yOkzndL+BjPIgOUhFgAg8t4CRwCwHQcUbDiaUPLgSTWiwOxAAdhYrve7ZXllYlVnhdDMj/GFpQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1746109094; c=relaxed/simple; bh=+/SwHnpZbgY2AcSm/UHqpVgDo7ICjQJaAELnNF/KmV4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=neuejVNvxOA++Xwy8/tEOUk1Rz+AAxyl3KTVdwkeNMOPfugpGZ+RJXb8KaIG+i+EDnqh2A4XGbEh1PChRljdE3FNumK6blwwEGxig5Kg/BPlPiQ4CS4Spw3ipc2dv2/gU1GQwMUUWGxo+jgso6NYlCU0BVYO+Ebx+I8+EFqE2Q0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=L1s7duk6; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="L1s7duk6" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90CEEC4CEE3; Thu, 1 May 2025 14:18:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1746109093; bh=+/SwHnpZbgY2AcSm/UHqpVgDo7ICjQJaAELnNF/KmV4=; h=From:To:Cc:Subject:Date:Reply-to:From; b=L1s7duk6NxQNZjw2pK8Ow0OXZu5szlju79cPZssolFA5d3zAE/S7xNXPJPYF7CVSM SIPIy0z814Cyw5mz+xBttNFLh1jYkdhLxhWT8U6k3toyZqrRRM4x38x0PLUjhu5iNL ephqZvrpIMYIv9xksVbQjMoo9lOtue1vkmaeyKz0= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-49908: Bluetooth: L2CAP: Fix memory leak in vhci_write Date: Thu, 1 May 2025 16:11:38 +0200 Message-ID: <2025050104-CVE-2022-49908-ad9a@gregkh> X-Mailer: git-send-email 2.49.0 Precedence: bulk X-Mailing-List: linux-cve-announce@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Reply-to: , X-Developer-Signature: v=1; a=openpgp-sha256; l=3835; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=+KlPNPWSRp1mRWOBlzOH8AafPNDFwyvRhUZbY2UVSQ0=; b=owGbwMvMwCRo6H6F97bub03G02pJDBnCDXuuirn5aZx71mPw0PsEb+7KCWd/Xf7GkC1vmv1fO kNs2uUFHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRdwUM83QK//w7YZZ/ZaOR hLS96lI1n2dn8xlmsySH8Wme/hYobBZV/+lu1aw50olmAA== X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit From: Greg Kroah-Hartman Description =========== In the Linux kernel, the following vulnerability has been resolved: Bluetooth: L2CAP: Fix memory leak in vhci_write 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: [] __alloc_skb+0x1f9/0x270 net/core/skbuff.c:418 [] alloc_skb include/linux/skbuff.h:1257 [inline] [] bt_skb_alloc include/net/bluetooth/bluetooth.h:469 [inline] [] vhci_get_user drivers/bluetooth/hci_vhci.c:391 [inline] [] vhci_write+0x5f/0x230 drivers/bluetooth/hci_vhci.c:511 [] call_write_iter include/linux/fs.h:2192 [inline] [] new_sync_write fs/read_write.c:491 [inline] [] vfs_write+0x42d/0x540 fs/read_write.c:578 [] ksys_write+0x9d/0x160 fs/read_write.c:631 [] do_syscall_x64 arch/x86/entry/common.c:50 [inline] [] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 [] entry_SYSCALL_64_after_hwframe+0x63/0xcd ==================================== HCI core will uses hci_rx_work() to process frame, which is queued to the hdev->rx_q tail in hci_recv_frame() 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->rx_skb and finishes frame process in l2cap_recv_acldata(), 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 l2cap_recv_acldata(). The Linux kernel CVE team has assigned CVE-2022-49908 to this issue. Affected and fixed versions =========================== Issue introduced in 5.12 with commit 4d7ea8ee90e42fc75995f6fb24032d3233314528 and fixed in 5.15.78 with commit aa16cac06b752e5f609c106735bd7838f444784c Issue introduced in 5.12 with commit 4d7ea8ee90e42fc75995f6fb24032d3233314528 and fixed in 6.0.8 with commit 5b4f039a2f487c5edae681d763fe1af505f84c13 Issue introduced in 5.12 with commit 4d7ea8ee90e42fc75995f6fb24032d3233314528 and fixed in 6.1 with commit 7c9524d929648935bac2bbb4c20437df8f9c3f42 Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community. Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at https://cve.org/CVERecord/?id=CVE-2022-49908 will be updated if fixes are backported, please check that for the most up to date information about this issue. Affected files ============== The file(s) affected by this issue are: net/bluetooth/l2cap_core.c Mitigation ========== The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits: https://git.kernel.org/stable/c/aa16cac06b752e5f609c106735bd7838f444784c https://git.kernel.org/stable/c/5b4f039a2f487c5edae681d763fe1af505f84c13 https://git.kernel.org/stable/c/7c9524d929648935bac2bbb4c20437df8f9c3f42