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 F3F3A18C03F for ; Sat, 4 Oct 2025 07:33:37 +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=1759563218; cv=none; b=Unn1QzWHFlXYsDi0qMypmV8zOTSzNXVdD5TQAuxwtVZEawkRF7zlG2HK/k4OUKFL8RbTeugVy4/PS6L/35Qx80QXG/8G9G54qh+ByfxpdUjTHIfLmZdNfKqwF7dV2OJGIydmVpb+6GpdhkUw5txznFmNvceS/ogmPtpRwdu0kWM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759563218; c=relaxed/simple; bh=IJgLMABOsSoPe2saDzvP/K4hDCqawn1A/NYeD6X3Eyk=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=jRVDuyeYgFowsmGjzDqO1w/Kx1JWP1OvOrVDD9dHvANqXDGhEAUOHdOov7XFHxNSHtGqkQn7VZkCEi3jJhhVMwjC+sh59PnQaPfLndE70fGKqCsbk8lVhpDWscpDTEDelhQ6NPMdgl+T4jW6T/6VMdMlUU5DtrVQgnm1yAhaLTc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=hW4eiH8M; 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="hW4eiH8M" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0D117C4CEF1; Sat, 4 Oct 2025 07:33:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1759563217; bh=IJgLMABOsSoPe2saDzvP/K4hDCqawn1A/NYeD6X3Eyk=; h=From:To:Cc:Subject:Date:Reply-to:From; b=hW4eiH8Mg9KWR/Fp0mRBiZfqX/7y+7UxQ2ag/kRcQD+iZoKSbxJ4wKZWO18nwC0/X VBfp9/qMjSO0U3+MFPb9Rz1efoKcY2O4Ld84vqOTb9Js+TrD3nr6yVnj9tVK7GiwQ4 sRJrem9SGvmKTklmJS061j0V/EFrrDNu5AIexR5U= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-39941: zram: fix slot write race condition Date: Sat, 4 Oct 2025 09:33:25 +0200 Message-ID: <2025100418-CVE-2025-39941-f256@gregkh> X-Mailer: git-send-email 2.51.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=2432; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=BxyXT1qAkYDrCSWDU1bSFQ/IAekhT5ANFoSqYtUf810=; b=owGbwMvMwCRo6H6F97bub03G02pJDBkPzu67/9ZUZ7Pa5qbcieFyS95bq1xa+8qcyeD8ZjmHD b8y7/z+0RHLwiDIxCArpsjyZRvP0f0VhxS9DG1Pw8xhZQIZwsDFKQATOf6BYUH7ZraNdX4yYTcE OIyXqe57dd3NagvDHC7WpbGlEewZQXK/2B2jPz3ZOumoNQA= 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: zram: fix slot write race condition Parallel concurrent writes to the same zram index result in leaked zsmalloc handles. Schematically we can have something like this: CPU0 CPU1 zram_slot_lock() zs_free(handle) zram_slot_lock() zram_slot_lock() zs_free(handle) zram_slot_lock() compress compress handle = zs_malloc() handle = zs_malloc() zram_slot_lock zram_set_handle(handle) zram_slot_lock zram_slot_lock zram_set_handle(handle) zram_slot_lock Either CPU0 or CPU1 zsmalloc handle will leak because zs_free() is done too early. In fact, we need to reset zram entry right before we set its new handle, all under the same slot lock scope. The Linux kernel CVE team has assigned CVE-2025-39941 to this issue. Affected and fixed versions =========================== Issue introduced in 6.14 with commit 71268035f5d734ad6373d953298bd5779985497a and fixed in 6.16.9 with commit ff750e9f2c4d63854c33967d1646b5e89a9a19a2 Issue introduced in 6.14 with commit 71268035f5d734ad6373d953298bd5779985497a and fixed in 6.17 with commit ce4be9e4307c5a60701ff6e0cafa74caffdc54ce 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-39941 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/block/zram/zram_drv.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/ff750e9f2c4d63854c33967d1646b5e89a9a19a2 https://git.kernel.org/stable/c/ce4be9e4307c5a60701ff6e0cafa74caffdc54ce