Bug 2301518 (CVE-2024-42151)

Summary: CVE-2024-42151 kernel: bpf: mark bpf_dummy_struct_ops.test_1 parameter as nullable
Product: [Other] Security Response Reporter: OSIDB Bzimport <bzimport>
Component: vulnerabilityAssignee: Product Security DevOps Team <prodsec-dev>
Status: NEW --- QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: dfreiber, drow, jburrell, vkumar
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 6.9.9, kernel 6.10 Doc Type: If docs needed, set a value
Doc Text:
A possible NULL pointer dereference was found in the Linux kernel in net/bpf/bpf_dummy_struct_ops.c. This may lead to compromised Availability.
Story Points: ---
Clone Of: Environment:
Last Closed: Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 2302018    
Bug Blocks:    

Description OSIDB Bzimport 2024-07-30 08:40:05 UTC
In the Linux kernel, the following vulnerability has been resolved:

bpf: mark bpf_dummy_struct_ops.test_1 parameter as nullable

Test case dummy_st_ops/dummy_init_ret_value passes NULL as the first
parameter of the test_1() function. Mark this parameter as nullable to
make verifier aware of such possibility.
Otherwise, NULL check in the test_1() code:

      SEC("struct_ops/test_1")
      int BPF_PROG(test_1, struct bpf_dummy_ops_state *state)
      {
            if (!state)
                    return ...;

            ... access state ...
      }

Might be removed by verifier, thus triggering NULL pointer dereference
under certain conditions.

Comment 1 Mauro Matteo Cascella 2024-07-31 11:03:09 UTC
Upstream advisory:
https://lore.kernel.org/linux-cve-announce/2024073033-CVE-2024-42151-b34a@gregkh/T

Comment 2 Mauro Matteo Cascella 2024-07-31 11:03:31 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2302018]