CVE-2024-27050

libbpf: Use OPTS_SET() macro in bpf_xdp_query()

State
Published
Severity
7.8 High
Published
May 1, 2024
Updated
Aug 5, 2026
Reserved
Feb 19, 2024

Read the record on cve.org

Description

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

libbpf: Use OPTS_SET() macro in bpf_xdp_query()

When the feature_flags and xdp_zc_max_segs fields were added to the libbpf bpf_xdp_query_opts, the code writing them did not use the OPTS_SET() macro. This causes libbpf to write to those fields unconditionally, which means that programs compiled against an older version of libbpf (with a smaller size of the bpf_xdp_query_opts struct) will have its stack corrupted by libbpf writing out of bounds.

The patch adding the feature_flags field has an early bail out if the feature_flags field is not part of the opts struct (via the OPTS_HAS) macro, but the patch adding xdp_zc_max_segs does not. For consistency, this fix just changes the assignments to both fields to use the OPTS_SET() macro.

Scores

CVSSScoreVectorSource
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HLinux
3.15.5 MediumCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:HCISA-ADP

Weaknesses

Affected Products

ProductVersions
LinuxLinux
  • 13ce2daa259a3bfbc9a5aeeee8b9a87058703731 to before fa5bef5e80c6a3321b2b1a7070436f3bc5daf07cAffected
  • 13ce2daa259a3bfbc9a5aeeee8b9a87058703731 to before 682ddd62abd4bdcee7584246903e7a2df005fe0dAffected
  • 13ce2daa259a3bfbc9a5aeeee8b9a87058703731 to before cd3be9843247edb8fc6fcd8d8237cbce2bc19f5eAffected
  • 13ce2daa259a3bfbc9a5aeeee8b9a87058703731 to before 92a871ab9fa59a74d013bc04f321026a057618e7Affected
LinuxLinux
  • 6.6Affected
  • before 6.6Not affected
  • 6.6.23 through 6.6.*Not affected
  • 6.7.11 through 6.7.*Not affected
  • 6.8.2 through 6.8.*Not affected
  • 6.9 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.