Skip to contentSkip to conversation

CVE-2026-99203: pipe: preserve existing fasync readers on writer setup failure

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Oct 28

lore
Share & tools
lore
#0 lore raw

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

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

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

pipe: preserve existing fasync readers on writer setup failure

F_SETFL and FIOASYNC decide whether to invoke ->fasync() before pipe_fasync() takes pipe->mutex. Two enables of one O_RDWR FIFO can therefore both enter the callback.

fasync_helper() allocates before checking for an existing entry. If the first enable installs both entries, a second enable can update the reader entry and then fail the allocation for the writer entry. The error path removes the pre-existing reader entry, clearing FASYNC while the writer entry remains registered. __fput() then skips ->fasync(), so a later pipe notification can dereference the freed file or its f_owner. An unprivileged memory-pressure reproducer triggers a KASAN slab-use-after-free in send_sigio() through this path.

Keep the reader helper's result and undo the registration only if this call added it. The pipe mutex serializes changes to both lists, so a failed new registration still removes its reader, while a failed duplicate preserves the existing registrations and FASYNC. Successful duplicate enables continue to update fa_fd as before.

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

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

	Issue introduced in 2.6.30 with commit 76398425bb06b07cc3a3b1ce169c67dc9d6874ed and fixed in 6.18.59 with commit 4c42ce499ce4b1c787e61082e3b13df4f30c4eaa
	Issue introduced in 2.6.30 with commit 76398425bb06b07cc3a3b1ce169c67dc9d6874ed and fixed in 7.2.13 with commit 2259809e5b7043c4ba20af7b14ba3e471cf55521
	Issue introduced in 2.6.30 with commit 76398425bb06b07cc3a3b1ce169c67dc9d6874ed and fixed in 7.3 with commit 40bb03d3ea6f6a915218508819ecc4d7a7fa260d

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-99203

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/pipe.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/4c42ce499ce4b1c787e61082e3b13df4f30c4eaa
	https://git.kernel.org/stable/c/2259809e5b7043c4ba20af7b14ba3e471cf55521
	https://git.kernel.org/stable/c/40bb03d3ea6f6a915218508819ecc4d7a7fa260d