Bug 2129419 (CVE-2022-2785)

Summary: CVE-2022-2785 kernel: out-of-bounds read due to improper check of bpf_sys_bpf() arguments
Product: [Other] Security Response Reporter: Guilherme de Almeida Suckevicz <gsuckevi>
Component: vulnerabilityAssignee: Nobody <nobody>
Status: NEW --- QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: unspecifiedCC: acaringi, adscvr, airlied, alciregi, bhu, brdeoliv, chwhite, crwood, ddepaula, debarbos, dvlasenk, ezulian, hdegoede, hkrzesin, hpa, jarod, jarodwilson, jburrell, jfaracco, jferlan, jforbes, jglisse, jlelli, joe.lawrence, jonathan, josef, jshortt, jstancek, jwboyer, jwyatt, kcarcia, kernel-maint, kernel-mgr, lgoncalv, linville, lzampier, masami256, mchehab, nmurray, ptalbert, qzhao, rvrbovsk, scweaver, steved, tyberry, vkumar, walters, williams
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: kernel 5.19 rc8 Doc Type: If docs needed, set a value
Doc Text:
An out-of-bounds (OOB) memory read problem was found in bpf in the Linux kernel's kernel/bpf/syscall.c function due to an improper check of bpf_sys_bpf() arguments. The bounds check failure allows a local attacker to access out-of-bounds memory, leading to a leak of internal kernel information.
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: 2129420, 2131595, 2131596, 2131597, 2131598    
Bug Blocks: 2129421    

Description Guilherme de Almeida Suckevicz 2022-09-23 17:09:22 UTC
There exists an arbitrary memory read within the Linux Kernel BPF - Constants provided to fill pointers in structs passed in to bpf_sys_bpf are not verified and can point anywhere, including memory not owned by BPF. An attacker with CAP_BPF can arbitrarily read memory from anywhere on the system. We recommend upgrading past commit 86f44fcec22c.

References and upstream fix:
https://git.kernel.org/bpf/bpf/c/86f44fcec22c
https://lore.kernel.org/bpf/20220816205517.682470-1-zhuyifei@google.com/T/#t

Comment 1 Guilherme de Almeida Suckevicz 2022-09-23 17:09:43 UTC
Created kernel tracking bugs for this issue:

Affects: fedora-all [bug 2129420]

Comment 2 Justin M. Forbes 2022-09-23 19:01:15 UTC
This was fixed for Fedora with the 5.19.8 stable kernel updates.