CVE-2022-50168: bpf, x86: fix freeing of not-finalized bpf_prog_pack

Published Jun 18, 2025
·
Updated

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

bpf, x86: fix freeing of not-finalized bpfprogpack

syzbot reported a few issues with bpfprogpack [1], [2]. This only happens with multiple subprogs. In jitsubprogs(), we first call bpfintjitcompile() on each sub program. And then, we call it on each sub program again. jitdata is not freed in the first call of bpfintjitcompile(). Similarly we don't call bpfjitbinarypackfinalize() in the first call of bpfintjitcompile().

If bpfintjitcompile() failed for one sub program, we will call bpfjitbinarypackfinalize() for this sub program. However, we don't have a chance to call it for other sub programs. Then we will hit "goto outfree" in jitsubprogs(), and call bpfjitfree on some subprograms that haven't got bpfjitbinarypackfinalize() yet.

At this point, bpfjitbinarypackfree() is called and the whole 2MB page is freed erroneously.

Fix this with a custom bpfjitfree() for x8664, which calls bpfjitbinarypackfinalize() if necessary. Also, with custom bpfjitfree(), bpfprogaux->usebpfprogpack is not needed any more, remove it.

[1] https://syzkaller.appspot.com/bug?extid=2f649ec6d2eea1495a8f [2] https://syzkaller.appspot.com/bug?extid=87f65c75f4a72db05445

Affected Software

7 affected componentsFixes available
Linux Linux kernel
Linux Linux kernel>=5.18<5.18.18
Linux Linux kernel>=5.19<5.19.2
debian/linux<6.0.2-1
6.0.2-1
debian/linux<6.0.2-1
6.0.2-1
debian/linux<6.0.2-1
6.0.2-1
debian/linux
6.0.2-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.0.2-1
  2. Compensating control

    For x86_64, implement a custom bpf_jit_free() that calls bpf_jit_binary_pack_finalize() when necessary before freeing subprograms, so an unfinalized bpf_prog_pack is not freed prematurely.

Event History

Jun 18, 2025
CVE Published
via MITRE·11:03 AM
Data Sourced
via MITRE·11:03 AM
Description
Data Sourced
via NVD·11:15 AM
Description
Data Sourced
via OSV·11:15 AM
DescriptionSeverityAffected Software
Data Sourced
via Red Hat·12:07 PM
DescriptionSeverityAffected Software
Dec 3, 2025
Data Sourced
via NVD·08:30 PM
RemedySeverityAffected Software
Aug 4, 2026
Data Sourced
via MITRE·09:07 AM
Severity
Updated
via NVD·10:18 AM
Severity

Frequently Asked Questions

1

What is the severity of CVE-2022-50168?

CVE-2022-50168 has been classified as a moderate severity vulnerability in the Linux kernel.

2

How do I fix CVE-2022-50168?

To address CVE-2022-50168, it is recommended to update the Linux kernel to the latest version that contains the fix.

3

What specific component is affected by CVE-2022-50168?

CVE-2022-50168 affects the BPF (Berkeley Packet Filter) functionality within the Linux kernel.

4

Is CVE-2022-50168 exploitable remotely?

CVE-2022-50168 does not appear to be exploitable remotely as it requires local access to the affected system.

5

What systems are likely impacted by CVE-2022-50168?

CVE-2022-50168 impacts systems running versions of the Linux kernel that utilize BPF with multiple subprogs.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203