CVE-2022-49967: bpf: Fix a data-race around bpf_jit_limit.
From: Greg Kroah-Hartman <[email protected]>
Description
===========
In the Linux kernel, the following vulnerability has been resolved:
bpf: Fix a data-race around bpf_jit_limit.
While reading bpf_jit_limit, it can be changed concurrently via sysctl, WRITE_ONCE() in __do_proc_doulongvec_minmax(). The size of bpf_jit_limit is long, so we need to add a paired READ_ONCE() to avoid load-tearing.
The Linux kernel CVE team has assigned CVE-2022-49967 to this issue.
Affected and fixed versions
===========================
Issue introduced in 4.20 with commit ede95a63b5e84ddeea6b0c473b36ab8bfd8c6ce3 and fixed in 5.19.8 with commit ba632ad0bacb13197a8f38e7526448974e87f292 Issue introduced in 4.20 with commit ede95a63b5e84ddeea6b0c473b36ab8bfd8c6ce3 and fixed in 6.0 with commit 0947ae1121083d363d522ff7518ee72b55bd8d29 Issue introduced in 4.9.190 with commit c98446e1bab6253ddce7144cc2a91c400a323839 Issue introduced in 4.14.140 with commit a1fe647042affe713a17243cd10e9b25f3d83948 Issue introduced in 4.19.47 with commit 43caa29c99db5a41b204e8ced01b00e151335ca8
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-2022-49967
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:
kernel/bpf/core.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/ba632ad0bacb13197a8f38e7526448974e87f292 https://git.kernel.org/stable/c/0947ae1121083d363d522ff7518ee72b55bd8d29