Subject: CVE-2024-47677: exfat: resolve memory leak from exfat_create_upcase_table()

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

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

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

exfat: resolve memory leak from exfat_create_upcase_table()

If exfat_load_upcase_table reaches end and returns -EINVAL,
allocated memory doesn't get freed and while
exfat_load_default_upcase_table allocates more memory, leading to a
memory leak.

Here's link to syzkaller crash report illustrating this issue:
https://syzkaller.appspot.com/text?tag=CrashReport&x=1406c201980000

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

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

	Issue introduced in 6.8 with commit a13d1a4de3b0 and fixed in 6.10.13 with commit f9835aec4967
	Issue introduced in 6.8 with commit a13d1a4de3b0 and fixed in 6.11.2 with commit 331ed2c739ce
	Issue introduced in 6.8 with commit a13d1a4de3b0 and fixed in 6.12-rc1 with commit c290fe508eee

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-47677
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/exfat/nls.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/f9835aec49670c46ebe2973032caaa1043b3d4da
	https://git.kernel.org/stable/c/331ed2c739ce656a67865f6b3ee0a478349d78cb
	https://git.kernel.org/stable/c/c290fe508eee36df1640c3cb35dc8f89e073c8a8