Subject: CVE-2024-35880: io_uring/kbuf: hold io_buffer_list reference over mmap

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

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

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

io_uring/kbuf: hold io_buffer_list reference over mmap

If we look up the kbuf, ensure that it doesn't get unregistered until
after we're done with it. Since we're inside mmap, we cannot safely use
the io_uring lock. Rely on the fact that we can lookup the buffer list
under RCU now and grab a reference to it, preventing it from being
unregistered until we're done with it. The lookup returns the
io_buffer_list directly with it referenced.

The Linux kernel CVE team has assigned CVE-2024-35880 to this issue.

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

	Issue introduced in 6.6.5 with commit 09f7520048ea and fixed in 6.6.26 with commit 65938e81df21
	Issue introduced in 6.7 with commit 5cf4f52e6d8a and fixed in 6.8.5 with commit 5fd8e2359498
	Issue introduced in 6.7 with commit 5cf4f52e6d8a and fixed in 6.9 with commit 561e4f9451d6

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-2024-35880
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:
	io_uring/io_uring.c
	io_uring/kbuf.c
	io_uring/kbuf.h

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/65938e81df2197203bda4b9a0c477e7987218d66
	https://git.kernel.org/stable/c/5fd8e2359498043e0b5329a05f02d10a9eb91eb9
	https://git.kernel.org/stable/c/561e4f9451d65fc2f7eef564e0064373e3019793