Subject: CVE-2024-36903: ipv6: Fix potential uninit-value access in __ip6_make_skb()

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

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

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

ipv6: Fix potential uninit-value access in __ip6_make_skb()

As it was done in commit fc1092f51567 ("ipv4: Fix uninit-value access in
__ip_make_skb()") for IPv4, check FLOWI_FLAG_KNOWN_NH on fl6->flowi6_flags
instead of testing HDRINCL on the socket to avoid a race condition which
causes uninit-value access.

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

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

	Issue introduced in 6.3 with commit ea30388baebc and fixed in 6.6.31 with commit 68c8ba16ab71
	Issue introduced in 6.3 with commit ea30388baebc and fixed in 6.8.10 with commit 2367bf254f3a
	Issue introduced in 6.3 with commit ea30388baebc and fixed in 6.9 with commit 4e13d3a9c25b
	Issue introduced in 4.14.313 with commit 165370522cc4
	Issue introduced in 4.19.281 with commit f394f690a30a
	Issue introduced in 5.4.241 with commit 0cf600ca1bdf
	Issue introduced in 5.10.178 with commit 605b056d6330
	Issue introduced in 5.15.107 with commit d65ff2fe877c
	Issue introduced in 6.1.24 with commit 2c9cefc142c1
	Issue introduced in 6.2.11 with commit 02ed5700f404

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-36903
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:
	net/ipv6/ip6_output.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/68c8ba16ab712eb709c6bab80ff151079d11d97a
	https://git.kernel.org/stable/c/2367bf254f3a27ecc6e229afd7a8b0a1395f7be3
	https://git.kernel.org/stable/c/4e13d3a9c25b7080f8a619f961e943fe08c2672c