Subject: CVE-2024-47710: sock_map: Add a cond_resched() in sock_hash_free()

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

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

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

sock_map: Add a cond_resched() in sock_hash_free()

Several syzbot soft lockup reports all have in common sock_hash_free()

If a map with a large number of buckets is destroyed, we need to yield
the cpu when needed.

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

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

	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 5.10.227 with commit 1a11a1a53255
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 5.15.168 with commit 984648aac87a
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 6.1.113 with commit 04f62c012e0e
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 6.6.54 with commit 80bd490ac0a3
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 6.10.13 with commit ae8c1b3e7353
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 6.11.2 with commit cd10abf41bae
	Issue introduced in 5.8 with commit 75e68e5bf2c7 and fixed in 6.12-rc1 with commit b1339be951ad
	Issue introduced in 5.4.49 with commit 5bed77b0a2a0
	Issue introduced in 5.7.6 with commit 6fc372656a1e

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-47710
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/core/sock_map.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/1a11a1a53255ddab8a903cdae01b9d3eb2c1a47b
	https://git.kernel.org/stable/c/984648aac87a6a1c8fd61663bec3f7b61eafad5e
	https://git.kernel.org/stable/c/04f62c012e0e4683e572b30baf6004ca0a3f6772
	https://git.kernel.org/stable/c/80bd490ac0a3b662a489e17d8eedeb1e905a3d40
	https://git.kernel.org/stable/c/ae8c1b3e7353ad240b829eabac7ba2584b2c6bdc
	https://git.kernel.org/stable/c/cd10abf41bae55c9d2b93f34a516dbf52626bcb7
	https://git.kernel.org/stable/c/b1339be951ad31947ae19bc25cb08769bf255100