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 E51E340BF5 for ; Mon, 31 Mar 2025 19:41:55 +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=1743450116; cv=none; b=gMaZdiUI+m8y+BjAbBUBW2XNHZz/5whM2jChvjklNyIgrmMVRjXzC2gnv4f0d/NSEDf06IEnPAFqikqO257lF3GGyE5VTv0Bvb2CLTHcuRY44jifPt/G1CPqjxuI5VQDO8hYsPRlO7N48NuwfAmK+CbTIZeCeenTqLwasqUQ3WM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1743450116; c=relaxed/simple; bh=me5GoFoNWqdZ93idNvWeuRcd5Z4sw7/fmT8zxRbTQus=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=GkZja9Bnqe1tYuzgeTsd+HDK8HhoDLwgb+ppcrtj5XAG/ZGDn+9yg7YTsVfPAHNP9NdlNaV7vJrOqzCpllrYHLiVW9rSN+qpFNODMPmpFoQZ9en4YsDF3AFLcPkZfZb5UtA6mJKvY42rzMeJ7nQZ1rLUPz4JJpDQDv7iIxGfWlc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=Eed39LXi; 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="Eed39LXi" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2064AC4CEE3; Mon, 31 Mar 2025 19:41:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1743450115; bh=me5GoFoNWqdZ93idNvWeuRcd5Z4sw7/fmT8zxRbTQus=; h=From:To:Cc:Subject:Date:Reply-to:From; b=Eed39LXi1nEAoQksp2+BlsAgBh6vn1X9tFyF2f0O+54fPGdTtIlzHFT4qfOmNf8I5 sK0/CBnAd8o5pkTW9at7SmDOUjT4SQTvak1ARprLE6zefSAzNwxqpVkpuS/b4UPmG3 Dl6Q+1x4wNBvUlXL5wKKRfZj0ew9iKCGSOrgWAoE= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-21893: keys: Fix UAF in key_put() Date: Mon, 31 Mar 2025 20:40:27 +0100 Message-ID: <2025033126-CVE-2025-21893-f2b4@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=2633; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=me5GoFoNWqdZ93idNvWeuRcd5Z4sw7/fmT8zxRbTQus=; b=owGbwMvMwCRo6H6F97bub03G02pJDOmv3q96vnFLvWHGZbOIawsuZzqtPGmueKiBo/bP3l+f2 hSNJ1ot7ohlYRBkYpAVU2T5so3n6P6KQ4pehranYeawMoEMYeDiFICJuGYyzC/esjDL9MyFMyfv 52YKbarRNrVhMGZYcHhPSWOKgGjjNqlZ+8u3NU+x/v3lKQA= 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: keys: Fix UAF in key_put() Once a key's reference count has been reduced to 0, the garbage collector thread may destroy it at any time and so key_put() is not allowed to touch the key after that point. The most key_put() is normally allowed to do is to touch key_gc_work as that's a static global variable. However, in an effort to speed up the reclamation of quota, this is now done in key_put() once the key's usage is reduced to 0 - but now the code is looking at the key after the deadline, which is forbidden. Fix this by using a flag to indicate that a key can be gc'd now rather than looking at the key's refcount in the garbage collector. The Linux kernel CVE team has assigned CVE-2025-21893 to this issue. Affected and fixed versions =========================== Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.12.21 with commit 6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3 Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.13.9 with commit f6a3cf833188e897c97028cd7b926e3f2cb1a8c0 Issue introduced in 6.10 with commit 9578e327b2b4935a25d49e3891b8fcca9b6c10c6 and fixed in 6.14 with commit 75845c6c1a64483e9985302793dbf0dfa5f71e32 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-2025-21893 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: include/linux/key.h security/keys/gc.c security/keys/key.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/6afe2ea2daec156bd94ad2c5a6f4f4c48240dcd3 https://git.kernel.org/stable/c/f6a3cf833188e897c97028cd7b926e3f2cb1a8c0 https://git.kernel.org/stable/c/75845c6c1a64483e9985302793dbf0dfa5f71e32