Subject: CVE-2023-52646: aio: fix mremap after fork null-deref

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

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

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

aio: fix mremap after fork null-deref

Commit e4a0d3e720e7 ("aio: Make it possible to remap aio ring") introduced
a null-deref if mremap is called on an old aio mapping after fork as
mm->ioctx_table will be set to NULL.

[[email-masked]: fix 80 column issue]

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

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

	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 4.14.306 with commit 808f1e4b5723
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 4.19.273 with commit d8dca1bfe9ad
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 5.4.232 with commit 4326d0080f7e
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 5.10.169 with commit c261f798f7ba
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 5.15.95 with commit 178993157e8c
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 6.1.13 with commit af126acf01a1
	Issue introduced in 3.19 with commit e4a0d3e720e7 and fixed in 6.2 with commit 81e9d6f86476

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-52646
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/aio.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/808f1e4b5723ae4eda724d2ad6f6638905eefd95
	https://git.kernel.org/stable/c/d8dca1bfe9adcae38b35add64977818c0c13dd22
	https://git.kernel.org/stable/c/4326d0080f7e84fba775da41d158f46cf9d3f1c2
	https://git.kernel.org/stable/c/c261f798f7baa8080cf0214081d43d5f86bb073f
	https://git.kernel.org/stable/c/178993157e8c50aef7f35d7d6d3b44bb428199e1
	https://git.kernel.org/stable/c/af126acf01a12bdb04986fd26fc2eb3b40249e0d
	https://git.kernel.org/stable/c/81e9d6f8647650a7bead74c5f926e29970e834d1