Subject: CVE-2024-50071: pinctrl: nuvoton: fix a double free in ma35_pinctrl_dt_node_to_map_func()

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

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

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

pinctrl: nuvoton: fix a double free in ma35_pinctrl_dt_node_to_map_func()

'new_map' is allocated using devm_* which takes care of freeing the
allocated data on device removal, call to

	.dt_free_map = pinconf_generic_dt_free_map

double frees the map as pinconf_generic_dt_free_map() calls
pinctrl_utils_free_map().

Fix this by using kcalloc() instead of auto-managed devm_kcalloc().

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

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

	Issue introduced in 6.11 with commit f805e356313b and fixed in 6.11.5 with commit 6441d9c3d71b
	Issue introduced in 6.11 with commit f805e356313b and fixed in 6.12-rc4 with commit 3fd976afe974

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-50071
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:
	drivers/pinctrl/nuvoton/pinctrl-ma35.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/6441d9c3d71b59c8fd27d4e381c7471a32ac1a68
	https://git.kernel.org/stable/c/3fd976afe9743110f20a23f93b7ff9693f2be4bf