Skip to contentSkip to conversation

CVE-2026-89543: sunrpc: fix use-after-free in __rpc_clnt_handle_event and __rpc_clnt_remove_pipedir

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 11

lore
Share & tools
lore
#0 lore raw

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

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

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

sunrpc: fix use-after-free in __rpc_clnt_handle_event and __rpc_clnt_remove_pipedir

Normal client creation goes through rpc_setup_pipedir(), which records clnt->pipefs_sb, but the mount-event path in __rpc_clnt_handle_event() calls rpc_setup_pipedir_sb() directly and never refreshes that field. The umount path also removes the directory without clearing clnt->pipefs_sb.

After a late pipefs mount or any remount, rpc_clnt_remove_pipedir() compares the current superblock against a stale pipefs_sb pointer and skips cleanup, leaving pipefs dentries whose inode private data still points at a freed rpc_clnt, leading to a potential use-after-free during subsequent rpc_info_open() or rpc_show_info() calls.

Fix this by properly updating clnt->pipefs_sb upon mount events and clearing it during unmount or failure paths.

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

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

	Issue introduced in 6.7 with commit bfca5fb4e97c46503ddfc582335917b0cc228264 and fixed in 6.18.50 with commit e769fcde3cc73e847b1eb3acd40c04a291cb0c0c
	Issue introduced in 6.7 with commit bfca5fb4e97c46503ddfc582335917b0cc228264 and fixed in 7.2.4 with commit cdf7a233cb94774b0e7df42d9157077983f5022c
	Issue introduced in 6.7 with commit bfca5fb4e97c46503ddfc582335917b0cc228264 and fixed in 7.3-rc1 with commit 932a8cf6abb2b2f8677b79153a823108d8861fe2
	Issue introduced in 4.19.318 with commit 17866066b8ac1cc38fb449670bc15dc9fee4b40a
	Issue introduced in 5.4.280 with commit 7d61d1da2ed1f682c41cae0c8d4719cdaccee5c5
	Issue introduced in 5.10.202 with commit dedf2a0eb9448ae73b270743e6ea9b108189df46
	Issue introduced in 5.15.140 with commit 194454afa6aa9d6ed74f0c57127bc8beb27c20df
	Issue introduced in 6.1.64 with commit 7749fd2dbef72a52b5c9ffdbf877691950ed4680
	Issue introduced in 6.5.13 with commit 1cdb52ffd6600a37bd355d8dce58ecd03e55e618
	Issue introduced in 6.6.3 with commit cc2e7ebbeb1d0601f7f3c8d93b78fcc03a95e44a

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

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:
net/sunrpc/clnt.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/e769fcde3cc73e847b1eb3acd40c04a291cb0c0c
	https://git.kernel.org/stable/c/cdf7a233cb94774b0e7df42d9157077983f5022c
	https://git.kernel.org/stable/c/932a8cf6abb2b2f8677b79153a823108d8861fe2