From mboxrd@z Thu Jan 1 00:00:00 1970 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 809DB1114 for ; Wed, 21 Aug 2024 06:12:28 +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=1724220748; cv=none; b=m0DzYA4TjfRxg4ua5NkTkFNohQaFQ5zkOPdszAFhfuKOMqjzJU4r/mHvY7o94kNCxXAck4pwFMnXsu7Wl3cTZglVDpcjCJrCFu+cIE7dcB8l3RH1XqN123PXEfWIChy4FA6WKHen7PqwIAiRznys9hoZraV04sGUHf3H0NtvPe0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724220748; c=relaxed/simple; bh=dttCAk6N/oB1tiiFH72LACpVnOrA3sULRx8QOSHiswk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=eDXvbEvYJOhlG9iZx2kp8y0JHpi4Fs3Wk/+skb/n7zJhCYJptpQyvp/FktFYE+1LjXLbBW0gP7BbIa4mqY3QaPuX7jC4ZREXNiyw/3TWcyO24ODMEAobxGchH0Deffzet+UAI0vPek8yO/OuY4qvMHMnFHgpjRxXvvdHmy8bcHQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=XnayvPBs; 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="XnayvPBs" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE907C32782; Wed, 21 Aug 2024 06:12:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1724220748; bh=dttCAk6N/oB1tiiFH72LACpVnOrA3sULRx8QOSHiswk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=XnayvPBs9fYgH1mG25IC/tHUKXUpPiRew6VW2/MT0f29zURVuv10ltPXHtPbmO+/V z/1wMa2r0giNxqfEoiWElbF7TiLhPcBLBMA4Jkh1v62P03DsD7QCDS0mtWxIFACJ1+ jRaQy3wRGl8hmrIgnjnyVC4nRdb92Qit3MLABSkw= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2022-48874: misc: fastrpc: Fix use-after-free and race in fastrpc_map_find Date: Wed, 21 Aug 2024 14:11:08 +0800 Message-ID: <2024082106-CVE-2022-48874-e8a4@gregkh> X-Mailer: git-send-email 2.46.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=2149; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=dttCAk6N/oB1tiiFH72LACpVnOrA3sULRx8QOSHiswk=; b=owGbwMvMwCRo6H6F97bub03G02pJDGlHW34dF1R67Ldt4d299cnT5n3xM7nAcvOLzR77U6dlj BrvfDvJ3BHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATufeFYcEFq717j22q2j1x RdYbVUMeiZIVzUcZ5ifIel+aeCMu6OCksmV+GtuWHVQIPQEA 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: misc: fastrpc: Fix use-after-free and race in fastrpc_map_find Currently, there is a race window between the point when the mutex is unlocked in fastrpc_map_lookup and the reference count increasing (fastrpc_map_get) in fastrpc_map_find, which can also lead to use-after-free. So lets merge fastrpc_map_find into fastrpc_map_lookup which allows us to both protect the maps list by also taking the &fl->lock spinlock and the reference count, since the spinlock will be released only after. Add take_ref argument to make this suitable for all callers. The Linux kernel CVE team has assigned CVE-2022-48874 to this issue. Affected and fixed versions =========================== Issue introduced in 5.18 with commit 8f6c1d8c4f0c and fixed in 6.1.8 with commit a50c5c25b6e7 Issue introduced in 5.18 with commit 8f6c1d8c4f0c and fixed in 6.2 with commit 9446fa1683a7 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-48874 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: drivers/misc/fastrpc.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/a50c5c25b6e7d2824698c0e6385f882a18f4a498 https://git.kernel.org/stable/c/9446fa1683a7e3937d9970248ced427c1983a1c5