# CVE-2022-49228: bpf: Fix a btf decl\_tag bug when tagging a function

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

- **Severity:** MEDIUM 5.5
- **CVSS:** 5.5 (v3.1, NVD) `CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H`
- **CVSS metrics:** Attack vector: Local; Attack complexity: Low; Privileges required: Low; User interaction: None; Scope: Unchanged; Confidentiality impact: None; Integrity impact: None; 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.28% (percentile 13, 2026-11-26)
- **CWE:** CWE-476
- **Published:** 2025-02-26T01:55:56.682Z
- **Modified:** 2026-06-17T05:17:26.820Z

## Who should check

- Anyone running Linux \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< a3bcd2110c087bc62e90fddd4a93237b049d6e68; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< 796d5666f6422ddadc938fb888044fcc16f2dbe3; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< d7e7b42f4f956f2c68ad8cda87d750093dbba737
- Anyone running Linux 5.16

## 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.

## Affected and fixed versions

- Linux: \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< a3bcd2110c087bc62e90fddd4a93237b049d6e68; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< 796d5666f6422ddadc938fb888044fcc16f2dbe3; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< d7e7b42f4f956f2c68ad8cda87d750093dbba737 (cvelist)
- Linux: 5.16 (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-49228. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2022-49228.md
Affected: Linux >= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, < a3bcd2110c087bc62e90fddd4a93237b049d6e68; >= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, < 796d5666f6422ddadc938fb888044fcc16f2dbe3; >= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, < d7e7b42f4f956f2c68ad8cda87d750093dbba737; Linux 5.16
Fixed in: Linux 796d5666f6422ddadc938fb888044fcc16f2dbe3

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-49228 being exploited?

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

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

Medium: CVSS 5.5 (v3.1, scored by NVD). Not remotely exploitable (local or adjacent access needed).

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

Linux \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< a3bcd2110c087bc62e90fddd4a93237b049d6e68; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< 796d5666f6422ddadc938fb888044fcc16f2dbe3; \>= b5ea834dde6b6e7f75e51d5f66dac8cd7c97b5ef, \< d7e7b42f4f956f2c68ad8cda87d750093dbba737; Linux 5.16.

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

Yes. Fixed in Linux 796d5666f6422ddadc938fb888044fcc16f2dbe3. No fix listed yet: follow the vendor advisory.

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

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/a3bcd2110c087bc62e90fddd4a93237b049d6e68>
- patch: <https://git.kernel.org/stable/c/796d5666f6422ddadc938fb888044fcc16f2dbe3>
- patch: <https://git.kernel.org/stable/c/d7e7b42f4f956f2c68ad8cda87d750093dbba737>

## 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-49228>

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