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 0113020296F for ; Wed, 16 Apr 2025 14:13:40 +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=1744812821; cv=none; b=mS5ugyFgo16oJJIW+I4B31tKYHlKDt4n5+dxQLROufcKxmUVc1LzYj9D2nj1BrKp0Pe86aEPbbQlFz3Ajs+wsbUxcgjH3zgwDzrwfK2wxaqFUbA6yKdEDIDfehiF24dDtlDyJO+oVqd+tIjm+vzD2aSP58Cg4Vh/tfGbNjtoCcE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744812821; c=relaxed/simple; bh=aGR00Eveo9X5N7NqQyX/sxpGy7e4jGtswKHqVkcnE80=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=NAiH4yqhpeK3f2SKQTkUH/WT3F/G/q6M/KGBs3fu2LbqpM+YfX26ru5u79BpzxHxz7fw+8L0/2iiqmGsTZiqDaDJ9CLyLumlBZhdZuI55UGUOl7gV2BKmX/h1TlsvNyO4jNUoWHvH0Il6+s9aLqwRtH3nDDRr1m11O+IW5y87Eo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=l6vYzSC0; 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="l6vYzSC0" Received: by smtp.kernel.org (Postfix) with ESMTPSA id ED8FDC4CEE2; Wed, 16 Apr 2025 14:13:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1744812820; bh=aGR00Eveo9X5N7NqQyX/sxpGy7e4jGtswKHqVkcnE80=; h=From:To:Cc:Subject:Date:Reply-to:From; b=l6vYzSC0KzG0JIZcRq03k5U02D7tTawn+qEBewoF5+uFUjoJYZw5KFA/POxK7wjTt AK1TcRQDBkwGtRjqd8YvEwfb8KRKZlOtxHk8UJL/N2Ho7UuE46YTWn6QjcZudlw41m Ptu/fdGKLZlog5wLBToPPDfqy7K/SzClgKsrKmyY= From: Greg Kroah-Hartman To: linux-cve-announce@vger.kernel.org Cc: Greg Kroah-Hartman Subject: CVE-2025-22029: exec: fix the racy usage of fs_struct->in_exec Date: Wed, 16 Apr 2025 16:12:00 +0200 Message-ID: <2025041655-CVE-2025-22029-349f@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=2425; i=gregkh@linuxfoundation.org; h=from:subject:message-id; bh=aGR00Eveo9X5N7NqQyX/sxpGy7e4jGtswKHqVkcnE80=; b=owGbwMvMwCRo6H6F97bub03G02pJDOn/d63hfHJs7ZUKwSc5ceJ9sxjz2EL1jnNInPZa6SFz3 6d/wZFbHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjAR3WyGBSeSBfaynjt4Qm+p oltQRUzjsaYpSxjmmSkeOTMnMFbPVibu+a1vV5li3i4VBQA= 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: exec: fix the racy usage of fs_struct->in_exec check_unsafe_exec() sets fs->in_exec under cred_guard_mutex, then execve() paths clear fs->in_exec lockless. This is fine if exec succeeds, but if it fails we have the following race: T1 sets fs->in_exec = 1, fails, drops cred_guard_mutex T2 sets fs->in_exec = 1 T1 clears fs->in_exec T2 continues with fs->in_exec == 0 Change fs/exec.c to clear fs->in_exec with cred_guard_mutex held. The Linux kernel CVE team has assigned CVE-2025-22029 to this issue. Affected and fixed versions =========================== Fixed in 6.6.87 with commit 753a620a7f8e134b444f89fe90873234e894e21a Fixed in 6.12.23 with commit e2d8e7bd3314485e0b3b08380c659b3d1d67ed6a Fixed in 6.13.11 with commit a6b5070721503fb6021ebed51c925ffc66b1c5ab Fixed in 6.14.2 with commit b519f2e5800fe2391b7545ba6889df795828e885 Fixed in 6.15-rc1 with commit af7bb0d2ca459f15cb5ca604dab5d9af103643f0 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-22029 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: fs/exec.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/753a620a7f8e134b444f89fe90873234e894e21a https://git.kernel.org/stable/c/e2d8e7bd3314485e0b3b08380c659b3d1d67ed6a https://git.kernel.org/stable/c/a6b5070721503fb6021ebed51c925ffc66b1c5ab https://git.kernel.org/stable/c/b519f2e5800fe2391b7545ba6889df795828e885 https://git.kernel.org/stable/c/af7bb0d2ca459f15cb5ca604dab5d9af103643f0