Bug 2311717 (CVE-2024-45020) - CVE-2024-45020 kernel: bpf: Fix a kernel verifier crash in stacksafe()
Summary: CVE-2024-45020 kernel: bpf: Fix a kernel verifier crash in stacksafe()
Keywords:
Status: NEW
Alias: CVE-2024-45020
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On: 2311764
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-09-11 16:21 UTC by OSIDB Bzimport
Modified: 2025-04-25 17:25 UTC (History)
4 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2025:0001 0 None None None 2025-01-01 07:22:57 UTC
Red Hat Product Errata RHSA-2024:11486 0 None None None 2024-12-19 00:43:10 UTC

Description OSIDB Bzimport 2024-09-11 16:21:08 UTC
In the Linux kernel, the following vulnerability has been resolved:

bpf: Fix a kernel verifier crash in stacksafe()

Daniel Hodges reported a kernel verifier crash when playing with sched-ext.
Further investigation shows that the crash is due to invalid memory access
in stacksafe(). More specifically, it is the following code:

    if (exact != NOT_EXACT &&
        old->stack[spi].slot_type[i % BPF_REG_SIZE] !=
        cur->stack[spi].slot_type[i % BPF_REG_SIZE])
            return false;

The 'i' iterates old->allocated_stack.
If cur->allocated_stack < old->allocated_stack the out-of-bound
access will happen.

To fix the issue add 'i >= cur->allocated_stack' check such that if
the condition is true, stacksafe() should fail. Otherwise,
cur->stack[spi].slot_type[i % BPF_REG_SIZE] memory access is legal.

Comment 3 errata-xmlrpc 2024-12-19 00:43:09 UTC
This issue has been addressed in the following products:

  Red Hat Enterprise Linux 9

Via RHSA-2024:11486 https://access.redhat.com/errata/RHSA-2024:11486


Note You need to log in before you can comment on or make changes to this bug.