CVE-2022-49548

bpf: Fix potential array overflow in bpf_trampoline_get_progs()

State
Published
Severity
7.8 High
Published
Feb 26, 2025
Updated
May 11, 2026
Reserved
Feb 26, 2025

Read the record on cve.org

Description

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

bpf: Fix potential array overflow in bpf_trampoline_get_progs()

The cnt value in the 'cnt >= BPF_MAX_TRAMP_PROGS' check does not include BPF_TRAMP_MODIFY_RETURN bpf programs, so the number of the attached BPF_TRAMP_MODIFY_RETURN bpf programs in a trampoline can exceed BPF_MAX_TRAMP_PROGS.

When this happens, the assignment '*progs++ = aux->prog' in bpf_trampoline_get_progs() will cause progs array overflow as the progs field in the bpf_tramp_progs struct can only hold at most BPF_MAX_TRAMP_PROGS bpf programs.

Scores

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

Weaknesses

  • CWE-129 Improper Validation of Array Index

Affected Products

ProductVersions
LinuxLinux
  • 88fd9e5352fe05f7fe57778293aebd4cd106960b to before 7f845de2863334bed4f362e95853f5e7bc323737Affected
  • 88fd9e5352fe05f7fe57778293aebd4cd106960b to before e36452d5da6325df7c10cffc60a9e68d21e2606dAffected
  • 88fd9e5352fe05f7fe57778293aebd4cd106960b to before 32c4559c61652f24c9fdd5440342196fe37453bcAffected
  • 88fd9e5352fe05f7fe57778293aebd4cd106960b to before 4f8897bcc20b9ae44758e0572538d741ab66f0dcAffected
  • 88fd9e5352fe05f7fe57778293aebd4cd106960b to before a2aa95b71c9bbec793b5c5fa50f0a80d882b3e8dAffected
LinuxLinux
  • 5.7Affected
  • before 5.7Not affected
  • 5.10.120 through 5.10.*Not affected
  • 5.15.45 through 5.15.*Not affected
  • 5.17.13 through 5.17.*Not affected
  • 5.18.2 through 5.18.*Not affected
  • 5.19 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.