# CVE-2022-49840: bpf, test\_run: Fix alignment problem in bpf\_prog\_test\_run\_skb()

> Archived entry. Full-text search covers entries since 2026-11-10; exact IDs work for all years.

- **Severity:** HIGH 7.8
- **CVSS:** 7.8 (v3.1, CNA) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: High; Integrity impact: High; Availability impact: High
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Not remotely exploitable (local or adjacent access needed)
- **EPSS:** 0.30% (percentile 15, 2026-11-26)
- **CWE:** CWE-416
- **Published:** 2025-05-01T14:09:56.233Z
- **Modified:** 2026-06-17T05:19:16.330Z

## Who should check

- Anyone running Linux \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 047824a730699c6c66df43306b80f700c9dfc2fd; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 730fb1ef974a13915bc7651364d8b3318891cd70; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 7a704dbfd3735304e261f2787c52fbc7c3884736; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< e60f37a1d379c821c17b08f366412dce9ef3d99f; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< eaa8edd86514afac9deb9bf9a5053e74f37edf40; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 1b597f2d6a55e9f549989913860ad5170da04964; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< d3fd203f36d46aa29600a72d57a1b61af80e4a25
- Anyone running Linux 4.12

## Description

In the Linux kernel, the following vulnerability has been resolved:

bpf, test\_run: Fix alignment problem in bpf\_prog\_test\_run\_skb()

We got a syzkaller problem because of aarch64 alignment fault
if KFENCE enabled. When the size from user bpf program is an odd
number, like 399, 407, etc, it will cause the struct skb\_shared\_info's
unaligned access. As seen below:

  BUG: KFENCE: use-after-free read in \_\_skb\_clone+0x23c/0x2a0 net/core/skbuff.c:1032

  Use-after-free read at 0xffff6254fffac077 (in kfence-\#213):
   \_\_lse\_atomic\_add arch/arm64/include/asm/atomic\_lse.h:26 \[inline\]
   arch\_atomic\_add arch/arm64/include/asm/atomic.h:28 \[inline\]
   arch\_atomic\_inc include/linux/atomic-arch-fallback.h:270 \[inline\]
   atomic\_inc include/asm-generic/atomic-instrumented.h:241 \[inline\]
   \_\_skb\_clone+0x23c/0x2a0 net/core/skbuff.c:1032
   skb\_clone+0xf4/0x214 net/core/skbuff.c:1481
   \_\_\_\_bpf\_clone\_redirect net/core/filter.c:2433 \[inline\]
   bpf\_clone\_redirect+0x78/0x1c0 net/core/filter.c:2420
   bpf\_prog\_d3839dd9068ceb51+0x80/0x330
   bpf\_dispatcher\_nop\_func include/linux/bpf.h:728 \[inline\]
   bpf\_test\_run+0x3c0/0x6c0 net/bpf/test\_run.c:53
   bpf\_prog\_test\_run\_skb+0x638/0xa7c net/bpf/test\_run.c:594
   bpf\_prog\_test\_run kernel/bpf/syscall.c:3148 \[inline\]
   \_\_do\_sys\_bpf kernel/bpf/syscall.c:4441 \[inline\]
   \_\_se\_sys\_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381

  kfence-\#213: 0xffff6254fffac000-0xffff6254fffac196, size=407, cache=kmalloc-512

  allocated by task 15074 on cpu 0 at 1342.585390s:
   kmalloc include/linux/slab.h:568 \[inline\]
   kzalloc include/linux/slab.h:675 \[inline\]
   bpf\_test\_init.isra.0+0xac/0x290 net/bpf/test\_run.c:191
   bpf\_prog\_test\_run\_skb+0x11c/0xa7c net/bpf/test\_run.c:512
   bpf\_prog\_test\_run kernel/bpf/syscall.c:3148 \[inline\]
   \_\_do\_sys\_bpf kernel/bpf/syscall.c:4441 \[inline\]
   \_\_se\_sys\_bpf+0xad0/0x1634 kernel/bpf/syscall.c:4381
   \_\_arm64\_sys\_bpf+0x50/0x60 kernel/bpf/syscall.c:4381

To fix the problem, we adjust @size so that (@size + @hearoom) is a
multiple of SMP\_CACHE\_BYTES. So we make sure the struct skb\_shared\_info
is aligned to a cache line.

## Affected and fixed versions

- Linux: \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 047824a730699c6c66df43306b80f700c9dfc2fd; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 730fb1ef974a13915bc7651364d8b3318891cd70; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 7a704dbfd3735304e261f2787c52fbc7c3884736; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< e60f37a1d379c821c17b08f366412dce9ef3d99f; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< eaa8edd86514afac9deb9bf9a5053e74f37edf40; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 1b597f2d6a55e9f549989913860ad5170da04964; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< d3fd203f36d46aa29600a72d57a1b61af80e4a25 (cvelist)
- Linux: 4.12 (cvelist)

## Mitigation

- No fix listed yet: follow the vendor advisory.

## Check your systems with an agent

Paste this into a coding agent:

```text
Check whether anything I run is affected by CVE-2022-49840. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49840.md
Affected: Linux >= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, < 047824a730699c6c66df43306b80f700c9dfc2fd; >= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, < 730fb1ef974a13915bc7651364d8b3318891cd70; >= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, < 7a704dbfd3735304e261f2787c52fbc7c3884736; >= 1cf1cae963c2e6032aebe16…
Fixed in: Linux 047824a730699c6c66df43306b80f700c9dfc2fd, Linux 730fb1ef974a13915bc7651364d8b3318891cd70, Linux 7a704dbfd3735304e261f2787c52fbc7c3884736, Linux 1b597f2d6a55e9f549989913860ad5170da04964

Steps:
1. Search this machine and project for Linux: dependency manifests and lockfiles, installed packages, container images and running services.
2. For each match, note the installed version and whether it is inside the affected range.
3. Report a table: location, installed version, affected (yes / no / unsure), evidence. If affected, say which fixed version or mitigation from the details link applies, but don't apply it.
```

## FAQ

### Is CVE-2022-49840 being exploited?

There is no confirmed exploitation: CVE-2022-49840 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known. EPSS estimates a 0.30% chance of exploitation in the next 30 days (as of 2026-11-26).

### How serious is CVE-2022-49840?

High: CVSS 7.8 (v3.1, scored by CNA). Not remotely exploitable (local or adjacent access needed).

### Which versions are affected by CVE-2022-49840?

Linux \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 047824a730699c6c66df43306b80f700c9dfc2fd; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 730fb1ef974a13915bc7651364d8b3318891cd70; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 7a704dbfd3735304e261f2787c52fbc7c3884736; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< e60f37a1d379c821c17b08f366412dce9ef3d99f; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< eaa8edd86514afac9deb9bf9a5053e74f37edf40; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< 1b597f2d6a55e9f549989913860ad5170da04964; \>= 1cf1cae963c2e6032aebe1637e995bc2f5d330f4, \< d3fd203f36d46aa29600a72d57a1b61af80e4a25; Linux 4.12.

### Is there a fix for CVE-2022-49840?

Yes. Fixed in Linux 047824a730699c6c66df43306b80f700c9dfc2fd, Linux 730fb1ef974a13915bc7651364d8b3318891cd70, Linux 7a704dbfd3735304e261f2787c52fbc7c3884736, Linux 1b597f2d6a55e9f549989913860ad5170da04964. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2022-49840?

Find where you use the affected software (dependency lockfiles, installed packages, container images, servers) and compare the installed version with the affected range above. The agent prompt on this page does this read-only.

## References

- patch: <https://git.kernel.org/stable/c/047824a730699c6c66df43306b80f700c9dfc2fd>
- patch: <https://git.kernel.org/stable/c/730fb1ef974a13915bc7651364d8b3318891cd70>
- patch: <https://git.kernel.org/stable/c/7a704dbfd3735304e261f2787c52fbc7c3884736>
- patch: <https://git.kernel.org/stable/c/e60f37a1d379c821c17b08f366412dce9ef3d99f>
- patch: <https://git.kernel.org/stable/c/eaa8edd86514afac9deb9bf9a5053e74f37edf40>
- patch: <https://git.kernel.org/stable/c/1b597f2d6a55e9f549989913860ad5170da04964>
- patch: <https://git.kernel.org/stable/c/d3fd203f36d46aa29600a72d57a1b61af80e4a25>

## Attribution

- CVE Program: CVE® is a registered trademark of The MITRE Corporation. CVE records © 1999–2026 The MITRE Corporation. <https://www.cve.org/Legal/TermsOfUse>
- NVD: This product uses data from the NVD API but is not endorsed or certified by the NVD. <https://nvd.nist.gov/vuln/detail/CVE-2022-49840>

HTML: <https://flawdb.com/CVE-2022-49840> · JSON: <https://flawdb.com/api/v1/entries/CVE-2022-49840>
