Subject: CVE-2023-52824: kernel: watch_queue: copy user-array safely

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

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

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

kernel: watch_queue: copy user-array safely

Currently, there is no overflow-check with memdup_user().

Use the new function memdup_array_user() instead of memdup_user() for
duplicating the user-space array safely.

The Linux kernel CVE team has assigned CVE-2023-52824 to this issue.

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

	Fixed in 5.15.140 with commit 22260dabcfe3
	Fixed in 6.1.64 with commit 6995df256e4f
	Fixed in 6.5.13 with commit c7acf02df167
	Fixed in 6.6.3 with commit 0f403ebad98e
	Fixed in 6.7 with commit ca0776571d31

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-2023-52824
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:
	kernel/watch_queue.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/22260dabcfe30ab70440d91aa1e4a703d13925c4
	https://git.kernel.org/stable/c/6995df256e4f5841fb45cf40d04f94b62b8067e1
	https://git.kernel.org/stable/c/c7acf02df1673a4ea7d6401ac4bc773ffe6a88f6
	https://git.kernel.org/stable/c/0f403ebad98e6151aaa9c96c9aae5549aa4d87cd
	https://git.kernel.org/stable/c/ca0776571d3163bd03b3e8c9e3da936abfaecbf6