CVE-2024-50161: bpf: Check the remaining info_cnt before repeating btf fields

Published Nov 7, 2024
·
Updated

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

bpf: Check the remaining infocnt before repeating btf fields

When trying to repeat the btf fields for array of nested struct, it doesn't check the remaining infocnt. The following splat will be reported when the value of ret nelems is greater than BTFFIELDSMAX:

------------[ cut here ]------------ UBSAN: array-index-out-of-bounds in ../kernel/bpf/btf.c:3951:49 index 11 is out of range for type 'btffieldinfo [11]' CPU: 6 UID: 0 PID: 411 Comm: testprogs ...... 6.11.0-rc4+ #1 Tainted: [O]=OOTMODULE Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS ... Call Trace: <TASK> dumpstacklvl+0x57/0x70 dumpstack+0x10/0x20 ubsanepilogue+0x9/0x40 ubsanhandleoutofbounds+0x6f/0x80 ? kallsymslookupname+0x48/0xb0 btfparsefields+0x992/0xce0 mapcreate+0x591/0x770 sysbpf+0x229/0x2410 x64sysbpf+0x1f/0x30 x64syscall+0x199/0x9f0 dosyscall64+0x3b/0xc0 entrySYSCALL64afterhwframe+0x4b/0x53 RIP: 0033:0x7fea56f2cc5d ...... </TASK> ---[ end trace ]---

Fix it by checking the remaining infocnt in btfrepeatfields() before repeating the btf fields.

Affected Software

5 affected componentsFixes available
Linux Linux kernel>=6.11<6.11.6
Linux Linux kernel=6.12-rc1
Linux Linux kernel=6.12-rc2
Linux Linux kernel=6.12-rc3
debian/linux
5.10.223-15.10.234-16.1.129-16.1.135-16.12.22-16.12.25-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 5.10.223-1Fixed in 5.10.234-1Fixed in 6.1.129-1Fixed in 6.1.135-1Fixed in 6.12.22-1Fixed in 6.12.25-1
  2. Upgrade

    Upgrade Linux kernel bpf/btf.c to a version that resolves this vulnerability.

    Patch bpf: Check the remaining info_cnt before repeating btf fields

Event History

Nov 7, 2024
CVE Published
via MITRE·09:31 AM
Data Sourced
via MITRE·09:31 AM
DescriptionSeverity
Data Sourced
via NVD·10:15 AM
RemedyDescriptionSeverityWeaknessAffected Software
Mar 28, 2025
Data Sourced
via Ubuntu·12:57 AM
RemedyDescriptionSeverityAffected Software

Frequently Asked Questions

1

What is the severity of CVE-2024-50161?

CVE-2024-50161 is considered to have a high severity due to potential impact on system stability.

2

How do I fix CVE-2024-50161?

To fix CVE-2024-50161, you should upgrade to the patched versions of the Linux kernel recommended by your distribution.

3

What versions of the Linux kernel are affected by CVE-2024-50161?

CVE-2024-50161 affects Linux kernel versions from 6.11.0 up to 6.11.6, as well as 6.12-rc1, 6.12-rc2, and 6.12-rc3.

4

Is there a workaround for CVE-2024-50161?

There is no known workaround for CVE-2024-50161 other than applying the appropriate kernel updates.

5

What is the nature of the vulnerability in CVE-2024-50161?

CVE-2024-50161 is a bug in the BPF subsystem that can lead to improper handling of struct fields when processing nested structures.

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