CVE-2022-50168
Severity CVSS v4.0:
Pending analysis
Type:
Unavailable / Other
Publication date:
18/06/2025
Last modified:
03/12/2025
Description
In the Linux kernel, the following vulnerability has been resolved:<br />
<br />
bpf, x86: fix freeing of not-finalized bpf_prog_pack<br />
<br />
syzbot reported a few issues with bpf_prog_pack [1], [2]. This only happens<br />
with multiple subprogs. In jit_subprogs(), we first call bpf_int_jit_compile()<br />
on each sub program. And then, we call it on each sub program again. jit_data<br />
is not freed in the first call of bpf_int_jit_compile(). Similarly we don&#39;t<br />
call bpf_jit_binary_pack_finalize() in the first call of bpf_int_jit_compile().<br />
<br />
If bpf_int_jit_compile() failed for one sub program, we will call<br />
bpf_jit_binary_pack_finalize() for this sub program. However, we don&#39;t have a<br />
chance to call it for other sub programs. Then we will hit "goto out_free" in<br />
jit_subprogs(), and call bpf_jit_free on some subprograms that haven&#39;t got<br />
bpf_jit_binary_pack_finalize() yet.<br />
<br />
At this point, bpf_jit_binary_pack_free() is called and the whole 2MB page is<br />
freed erroneously.<br />
<br />
Fix this with a custom bpf_jit_free() for x86_64, which calls<br />
bpf_jit_binary_pack_finalize() if necessary. Also, with custom<br />
bpf_jit_free(), bpf_prog_aux->use_bpf_prog_pack is not needed any more,<br />
remove it.<br />
<br />
[1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f<br />
[2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445
Impact
Base Score 3.x
7.80
Severity 3.x
HIGH
Vulnerable products and versions
| CPE | From | Up to |
|---|---|---|
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.18 (including) | 5.18.18 (excluding) |
| cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:* | 5.19 (including) | 5.19.2 (excluding) |
To consult the complete list of CPE names with products and versions, see this page



