CVE-2024-50123: bpf: Add the missing BPF_LINK_TYPE invocation for sockmap
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Add the missing BPF_LINK_TYPE invocation for sockmap
There is an out-of-bounds read in bpf_link_show_fdinfo() for the sockmap link fd. Fix it by adding the missing BPF_LINK_TYPE invocation for sockmap link
Also add comments for bpf_link_type to prevent missing updates in the future.
The Linux kernel CVE team has assigned CVE-2024-50123 to this issue.
Affected and fixed versions
===========================
Issue introduced in 6.10 with commit 699c23f02c65 and fixed in 6.11.6 with commit 6d79f12c0ce2 Issue introduced in 6.10 with commit 699c23f02c65 and fixed in 6.12-rc5 with commit c2f803052bc7
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-50123
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:
include/linux/bpf_types.h
include/uapi/linux/bpf.h
tools/include/uapi/linux/bpf.h
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/6d79f12c0ce2bc8ff5f109093df1734bd6450615 https://git.kernel.org/stable/c/c2f803052bc7a7feb2e03befccc8e49b6ff1f5f5