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 26EEB1E892 for ; Mon, 29 Jul 2024 14:58:32 +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=1722265113; cv=none; b=ZFyQmZwbadOfvhy6NBadIp23HPvvOq6rqlY8NxxwIbghK17EBJrRomq13xZksEr+OHa8ODAoYIuDsAWiaueozQdNi1ljOXOjrZTLp8S+IVOVbx8j3Zf52miIIaGXTAY5nKtwflUkbekMFIrZM4dcx1Rg0ce1cXYc48Etzyt530k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1722265113; c=relaxed/simple; bh=w4EmXfhFi7zUzT1wYhrjb0+wt9Q0RmQUDEjoWIrt510=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jiBPX9excndQW55iuU4tyJMzZGbuujTCftzMTQYtFPCkqivAnc6EBk7Q1D1BgYPyfUYCnzWsOlbcXS0jAEplEope/Xi+Y0/6JXZ2F2osCRqow7kHn/xE0ROidWiYye+LEI526KqRyKpM2BbZPDDCOWRo2NtyESsnj2pHmAy/d4w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=xXlKfAmr; 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="xXlKfAmr" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6BAB6C4AF0A; Mon, 29 Jul 2024 14:58:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1722265112; bh=w4EmXfhFi7zUzT1wYhrjb0+wt9Q0RmQUDEjoWIrt510=; h=From:To:Cc:Subject:Date:Reply-to:From; b=xXlKfAmraUcPPQpw0ooUNJpx1K1CTwkSbZurwmHIUnHWMCMroYf734ZqL9l5JiMMH YBxQwFtaiMbbtSKdtYBTgiSZZq8KaPnpgdD9+P/7+/vwPVKz6Vu8fd2mMkvjXxYTYK g4EqYvdQ26nTbOQUkOnOi/FgbO1XJxSyEYSScefo= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2024-41062: bluetooth/l2cap: sync sock recv cb and release Date: Mon, 29 Jul 2024 16:58:08 +0200 Message-ID: <2024072906-CVE-2024-41062-cb85@gregkh> X-Mailer: git-send-email 2.45.2 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=2679; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=w4EmXfhFi7zUzT1wYhrjb0+wt9Q0RmQUDEjoWIrt510=; b=owGbwMvMwCRo6H6F97bub03G02pJDGnL1/6Lv3Tv/mdB+7ApTRMFmT5EHFCTk1SN+PO2MGJz+ 8ksm4WJHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjCRUwoM830jzn8490DfcKdc iPLr5wHTJM9+M2ZYsN6umUtSib/X4aqFyvrD25Nvlq8UBgA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit Description =========== In the Linux kernel, the following vulnerability has been resolved: bluetooth/l2cap: sync sock recv cb and release The problem occurs between the system call to close the sock and hci_rx_work, where the former releases the sock and the latter accesses it without lock protection. CPU0 CPU1 ---- ---- sock_close hci_rx_work l2cap_sock_release hci_acldata_packet l2cap_sock_kill l2cap_recv_frame sk_free l2cap_conless_channel l2cap_sock_recv_cb If hci_rx_work processes the data that needs to be received before the sock is closed, then everything is normal; Otherwise, the work thread may access the released sock when receiving data. Add a chan mutex in the rx callback of the sock to achieve synchronization between the sock release and recv cb. Sock is dead, so set chan data to NULL, avoid others use invalid sock pointer. The Linux kernel CVE team has assigned CVE-2024-41062 to this issue. Affected and fixed versions =========================== Fixed in 6.1.101 with commit 605572e64cd9 Fixed in 6.6.42 with commit b803f30ea23e Fixed in 6.9.11 with commit 3b732449b781 Fixed in 6.10 with commit 89e856e124f9 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-2024-41062 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_sock.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/605572e64cd9cebb05ed609d96cff05b50d18cdf https://git.kernel.org/stable/c/b803f30ea23e0968b6c8285c42adf0d862ab2bf6 https://git.kernel.org/stable/c/3b732449b78183d17178db40be3a4401cf3cd629 https://git.kernel.org/stable/c/89e856e124f9ae548572c56b1b70c2255705f8fe