Skip to contentSkip to conversation

CVE-2026-98388: exec: do_close_on_exec() before taking exec_update_lock

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 14

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

exec: do_close_on_exec() before taking exec_update_lock

do_close_on_exec() currently happens while holding the exec_update_lock, which is used in a lot of places that access process state to synchronize access checks.
I recently added another such use of exec_update_lock, causing a regression.

do_close_on_exec() can block waiting for a reply from a filesystem. That means a hung filesystem can block codepaths that use exec_update_lock; and it also means that a FUSE filesystem which attempts to inspect the calling process can deadlock.

To avoid such problems, move do_close_on_exec() before the exec_update_lock is taken, but after the FD table has been copied if necessary.

I have looked through all the calls between the old and new position of the do_close_on_exec() call; there seems to be no file descriptor table access in between.

The Linux kernel CVE team has assigned CVE-2026-98388 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 5.10.261 with commit ae1e630bcaac739f625822078edbaea98366930d and fixed in 5.10.271 with commit 955973fff4a36d39a848b00cac1706863f568fe1
	Issue introduced in 5.15.212 with commit d54f14655fd7d7b293698a8b6918563c4c0465e7 and fixed in 5.15.222 with commit 550feab5b01000ab314868b62211fb3ddfd600e8
	Issue introduced in 6.1.178 with commit bb43679356f1f2a4c6b1c88aec4f021e5b5c74e9 and fixed in 6.1.189 with commit 5aacc19ba2b1faf84c4a2f2cf9a1784e03d1ff38
	Issue introduced in 6.6.145 with commit 7456ae990a9738962b33146916fabca62ae3d4e0 and fixed in 6.6.158 with commit 3feb4020bfb7ccf0d347f27051639d25e19cd65d
	Issue introduced in 6.12.97 with commit 4bfe8c481846cee52473a2f7d7b30ee8e6749fc4 and fixed in 6.12.111 with commit 0d86cd6b709c39216e6ee5ea8f0fc4242bbb2b53
	Issue introduced in 6.18.40 with commit f9b4b03ccc9c69bf7f7298d4559906ebea7143b3 and fixed in 6.18.53 with commit 19ddef61ee0a49782a60f8f497e50597ad5de2da
	Issue introduced in 7.2 with commit 6650527444dadc63d84aa939d14ecba4fadb2f69 and fixed in 7.2.7 with commit 63be3d8511bdafa095cd14a393cbf3c58dbbb928
	Issue introduced in 7.2 with commit 6650527444dadc63d84aa939d14ecba4fadb2f69 and fixed in 7.3-rc3 with commit e780259b54e618ceb4763fbc21314acf3565e813
	Issue introduced in 7.1.4 with commit c1cfd63326f5d09999134e9052c353faf738286e

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-2026-98388

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/955973fff4a36d39a848b00cac1706863f568fe1
	https://git.kernel.org/stable/c/550feab5b01000ab314868b62211fb3ddfd600e8
	https://git.kernel.org/stable/c/5aacc19ba2b1faf84c4a2f2cf9a1784e03d1ff38
	https://git.kernel.org/stable/c/3feb4020bfb7ccf0d347f27051639d25e19cd65d
	https://git.kernel.org/stable/c/0d86cd6b709c39216e6ee5ea8f0fc4242bbb2b53
	https://git.kernel.org/stable/c/19ddef61ee0a49782a60f8f497e50597ad5de2da
	https://git.kernel.org/stable/c/63be3d8511bdafa095cd14a393cbf3c58dbbb928
	https://git.kernel.org/stable/c/e780259b54e618ceb4763fbc21314acf3565e813