CVE-2022-49961

7.1 HIGH

📋 TL;DR

This Linux kernel vulnerability in the BPF verifier allows privileged users with CAP_BPF capability to bypass memory bounds checking, potentially leading to out-of-bounds memory access. The flaw occurs when the verifier incorrectly prunes states during verification, allowing programs that should be rejected to pass. Only users with CAP_BPF privilege are affected.

💻 Affected Systems

Products:
  • Linux Kernel
Versions: Kernel versions before the fix in commit 2459615a8d7f44ac81f0965bc094e55ccb254717
Operating Systems: All Linux distributions using affected kernel versions
Default Config Vulnerable: ✅ No
Notes: Only exploitable by users with CAP_BPF capability. Unprivileged BPF users are not affected as reg->precise is always true for them.

📦 What is this software?

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

Linux Kernel by Linux

The Linux Kernel is the core component of the Linux operating system, serving as the critical interface between computer hardware and software processes. As the heart of millions of servers, cloud infrastructure, embedded systems, Android devices, and IoT deployments worldwide, the Linux Kernel mana...

Learn more about Linux Kernel →

⚠️ Risk & Real-World Impact

🔴

Worst Case

Privileged attacker with CAP_BPF can execute arbitrary code in kernel context, leading to full system compromise, data corruption, or denial of service.

🟠

Likely Case

Privileged user could cause kernel crashes, memory corruption, or bypass security controls through carefully crafted BPF programs.

🟢

If Mitigated

With proper capability restrictions and unprivileged BPF disabled, impact is limited to users who already have elevated privileges.

🌐 Internet-Facing: LOW - Requires local access and CAP_BPF capability, not directly exploitable over network.
🏢 Internal Only: MEDIUM - Could be exploited by malicious insiders or compromised accounts with CAP_BPF privileges.

🎯 Exploit Status

Public PoC: ✅ No
Weaponized: UNKNOWN
Unauthenticated Exploit: ✅ No
Complexity: HIGH

Exploitation requires deep understanding of BPF verifier internals and ability to craft specific BPF programs that trigger the precision marking issue.

🛠️ Fix & Mitigation

✅ Official Fix

Patch Version: Kernel versions with commit 2459615a8d7f44ac81f0965bc094e55ccb254717 or later

Vendor Advisory: https://git.kernel.org/stable/c/2459615a8d7f44ac81f0965bc094e55ccb254717

Restart Required: Yes

Instructions:

1. Update Linux kernel to version containing the fix commit. 2. Reboot system to load new kernel. 3. Verify kernel version after reboot.

🔧 Temporary Workarounds

Remove CAP_BPF from users

linux

Remove CAP_BPF capability from users who don't require it to prevent exploitation

setcap -r cap_bpf /path/to/binary
capsh --drop=cap_bpf -- -c "your_command"

Disable unprivileged BPF

linux

Set kernel.unprivileged_bpf_disabled sysctl to prevent BPF program loading by unprivileged users

sysctl -w kernel.unprivileged_bpf_disabled=1
echo 'kernel.unprivileged_bpf_disabled = 1' >> /etc/sysctl.conf

🧯 If You Can't Patch

  • Restrict CAP_BPF capability to only essential users and processes
  • Implement strict BPF program auditing and monitoring for suspicious activity

🔍 How to Verify

Check if Vulnerable:

Check kernel version and verify if it contains the fix commit: uname -r and check git log

Check Version:

uname -r

Verify Fix Applied:

Verify kernel version is newer than vulnerable versions and contains commit 2459615a8d7f44ac81f0965bc094e55ccb254717

📡 Detection & Monitoring

Log Indicators:

  • Kernel oops messages
  • BPF program loading failures
  • Unexpected memory access violations

Network Indicators:

  • Not applicable - local vulnerability

SIEM Query:

Search for: kernel.*bpf.*error OR kernel.*verifier.*fail OR cap_bpf privilege escalation

🔗 References

📤 Share & Export