Subject: CVE-2022-48816: SUNRPC: lock against ->sock changing during sysfs read

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

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

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

SUNRPC: lock against ->sock changing during sysfs read

->sock can be set to NULL asynchronously unless ->recv_mutex is held.
So it is important to hold that mutex.  Otherwise a sysfs read can
trigger an oops.
Commit 17f09d3f619a ("SUNRPC: Check if the xprt is connected before
handling sysfs reads") appears to attempt to fix this problem, but it
only narrows the race window.

The Linux kernel CVE team has assigned CVE-2022-48816 to this issue.

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

	Issue introduced in 5.14 with commit a8482488a7d6 and fixed in 5.16.10 with commit 9482ab4540f5
	Issue introduced in 5.14 with commit a8482488a7d6 and fixed in 5.17 with commit b49ea673e119
	Issue introduced in 5.10.67 with commit 21a2be1a5145
	Issue introduced in 5.13.19 with commit 77876473912d

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-2022-48816
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/sysfs.c
	net/sunrpc/xprtsock.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/9482ab4540f5bcc869b44c067ae99b5fca16bd07
	https://git.kernel.org/stable/c/b49ea673e119f59c71645e2f65b3ccad857c90ee