Skip to main content

CVE-2022-49228: Vulnerability in Linux Linux

High
VulnerabilityCVE-2022-49228cvecve-2022-49228
Published: Wed Feb 26 2025 (02/26/2025, 01:55:56 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: bpf: Fix a btf decl_tag bug when tagging a function syzbot reported a btf decl_tag bug with stack trace below: general protection fault, probably for non-canonical address 0xdffffc0000000000: 0000 [#1] PREEMPT SMP KASAN KASAN: null-ptr-deref in range [0x0000000000000000-0x0000000000000007] CPU: 0 PID: 3592 Comm: syz-executor914 Not tainted 5.16.0-syzkaller-11424-gb7892f7d5cb2 #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:btf_type_vlen include/linux/btf.h:231 [inline] RIP: 0010:btf_decl_tag_resolve+0x83e/0xaa0 kernel/bpf/btf.c:3910 ... Call Trace: <TASK> btf_resolve+0x251/0x1020 kernel/bpf/btf.c:4198 btf_check_all_types kernel/bpf/btf.c:4239 [inline] btf_parse_type_sec kernel/bpf/btf.c:4280 [inline] btf_parse kernel/bpf/btf.c:4513 [inline] btf_new_fd+0x19fe/0x2370 kernel/bpf/btf.c:6047 bpf_btf_load kernel/bpf/syscall.c:4039 [inline] __sys_bpf+0x1cbb/0x5970 kernel/bpf/syscall.c:4679 __do_sys_bpf kernel/bpf/syscall.c:4738 [inline] __se_sys_bpf kernel/bpf/syscall.c:4736 [inline] __x64_sys_bpf+0x75/0xb0 kernel/bpf/syscall.c:4736 do_syscall_x64 arch/x86/entry/common.c:50 [inline] do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 entry_SYSCALL_64_after_hwframe+0x44/0xae The kasan error is triggered with an illegal BTF like below: type 0: void type 1: int type 2: decl_tag to func type 3 type 3: func to func_proto type 8 The total number of types is 4 and the type 3 is illegal since its func_proto type is out of range. Currently, the target type of decl_tag can be struct/union, var or func. Both struct/union and var implemented their own 'resolve' callback functions and hence handled properly in kernel. But func type doesn't have 'resolve' callback function. When btf_decl_tag_resolve() tries to check func type, it tries to get vlen of its func_proto type, which triggered the above kasan error. To fix the issue, btf_decl_tag_resolve() needs to do btf_func_check() before trying to accessing func_proto type. In the current implementation, func type is checked with btf_func_check() in the main checking function btf_check_all_types(). To fix the above kasan issue, let us implement 'resolve' callback func type properly. The 'resolve' callback will be also called in btf_check_all_types() for func types.

AI-Powered Analysis

AILast updated: 06/30/2025, 04:27:48 UTC

Technical Analysis

CVE-2022-49228 is a vulnerability identified in the Linux kernel's BPF (Berkeley Packet Filter) subsystem, specifically related to the handling of BTF (BPF Type Format) declaration tags. The issue arises from improper validation and resolution of function types within BTF data structures. BPF is a powerful kernel feature used for packet filtering, tracing, and other advanced networking and system monitoring tasks. BTF provides type information to BPF programs, enabling better introspection and verification. The vulnerability is triggered when an illegal BTF declaration tag references a function type whose associated function prototype type is out of the valid range. In the affected Linux kernel versions, the function btf_decl_tag_resolve() attempts to access the variable length (vlen) of the function prototype type without first validating the function type with btf_func_check(). This leads to a kernel null pointer dereference and a general protection fault, as detected by KASAN (Kernel Address Sanitizer). The root cause is that the 'func' type does not have a proper 'resolve' callback implemented, unlike other types such as struct/union or var, which have their own resolve callbacks to handle validation. This flaw can cause a kernel crash (denial of service) when processing malformed BTF data, potentially supplied by unprivileged users via the bpf syscall interface. The stack trace and error logs indicate that the fault occurs during BTF parsing and resolution, which is part of loading BPF programs. The fix involves implementing a proper 'resolve' callback for function types and ensuring btf_func_check() is called before accessing the function prototype type's vlen, preventing the null pointer dereference. No known exploits are reported in the wild, and the vulnerability requires interaction with the bpf syscall interface, which is typically restricted to privileged users or specific capabilities. However, the impact of a kernel crash can be significant, especially on production systems running critical workloads. This vulnerability affects Linux kernel versions containing the specified commit hashes prior to the patch and is relevant to any Linux distribution using these kernel versions or derivatives thereof.

Potential Impact

For European organizations, the impact of CVE-2022-49228 primarily involves potential denial of service through kernel crashes triggered by malformed BPF programs or data. Since BPF is widely used in modern Linux environments for networking, security monitoring, and performance tracing, a successful exploitation could disrupt critical services, especially in data centers, cloud infrastructure, and enterprise servers running Linux. This could lead to downtime, loss of availability, and operational disruption. Confidentiality and integrity impacts are limited as the vulnerability causes a crash rather than arbitrary code execution or privilege escalation. However, repeated crashes could be leveraged as part of a broader attack to degrade service or distract security teams. Given the kernel-level nature of the flaw, recovery requires system reboots and patching, which could affect service continuity. European organizations relying on Linux-based cloud platforms, container orchestration systems (e.g., Kubernetes nodes), or network appliances are particularly at risk if they run vulnerable kernel versions. The absence of known exploits reduces immediate risk, but the presence of an unpatched kernel vulnerability in critical infrastructure is a concern for compliance and operational security.

Mitigation Recommendations

1. Apply Kernel Updates: Organizations should promptly apply the official Linux kernel patches that implement the fix for CVE-2022-49228. This includes updating to kernel versions where the 'resolve' callback for function types in BTF is properly implemented and btf_func_check() is enforced. 2. Restrict BPF Usage: Limit access to the bpf syscall interface to trusted and privileged users only. Employ Linux capabilities (e.g., CAP_BPF) and seccomp filters to restrict unprivileged or unnecessary processes from loading BPF programs. 3. Monitor Kernel Logs: Implement monitoring for kernel crash logs and KASAN reports that may indicate attempts to exploit malformed BPF data. Early detection can help in incident response. 4. Harden Kernel Configuration: Disable or restrict BPF features if not required, using kernel configuration options or runtime controls, to reduce the attack surface. 5. Use Security Modules: Employ Linux Security Modules (LSMs) such as SELinux or AppArmor to enforce policies that limit BPF program loading and execution. 6. Test Updates in Staging: Before deploying kernel updates in production, test them in staging environments to ensure stability and compatibility, minimizing downtime. 7. Incident Response Preparedness: Prepare for potential denial of service scenarios by having rapid rollback and recovery procedures, including automated reboots and patch deployment pipelines.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-02-26T01:49:39.293Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d982dc4522896dcbe5343

Added to database: 5/21/2025, 9:09:01 AM

Last enriched: 6/30/2025, 4:27:48 AM

Last updated: 8/7/2025, 5:34:38 AM

Views: 12

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats