# CVE-2026-142820: kgdb: Fix buffer overflow in the 'm' packet handler

- **Severity:** UNSCORED
- **Exploited in the wild:** Not in CISA KEV
- **Public exploit / PoC:** None known
- **Remote exploitation:** Unknown
- **Published:** 2026-12-03T03:20:39.474Z
- **Modified:** 2026-12-03T04:18:17.443Z

## Who should check

- Anyone running Linux \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 45713e6218a0ae6e64a098593abaeab330ed476a; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< b6ee49b448b539bbf09f638b57bbfb76da343764; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< e4eb329621b594a18e53f40c4021a0e18492dadb; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 17e89acda585072f5bce5852f16ddf5063c83819; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 1397005178f69365f94457f1a402835f5e498008; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 129119bb1c3dba3c47bc620a831355dbd1451c7b; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 61485a6e004eaf84d5ee4d7eb27501247ce77524; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< ac0159129e2cb99a70c4b80cfbf58d03e092dc7b
- Anyone running Linux 2.6.26

## Description

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

kgdb: Fix buffer overflow in the 'm' packet handler

gdb\_cmd\_memread() passes the length of the 'm' packet straight to
kgdb\_mem2hex(), which hex-encodes the reply into
remcom\_out\_buffer\[BUFMAX\] without checking that the reply fits. A
client on the KGDB I/O console can ask for a read of any size, and
the hex encoding runs off the end of the buffer. kgdb\_mem2hex() takes
that length as an int count, so 2^31 truncates to a negative value
and copy\_from\_kernel\_nofault() is handed buf + count as its
destination.

On x86 BUFMAX is 1024, so a read of 512 bytes overruns by the single
byte that terminates the hex string:

  BUG: KASAN: global-out-of-bounds in kgdb\_mem2hex+0x1dd/0x230
  Write of size 1 at addr ffffffff87651780 by task sh/1
  ...
  The buggy address belongs to the variable:
   remcom\_out\_buffer+0x400/0x420

Bounds check the length before the hex encoding:

		if (length \> (BUFMAX - 1) / 2) {
			error\_packet(remcom\_out\_buffer, -EINVAL);
			return;
		}

gdbstub\_msg\_write() already bounds the count it hex-encodes
against BUFMAX. Reads over the limit never returned valid data,
so an error reply loses nothing.

## Affected and fixed versions

- Linux: \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 45713e6218a0ae6e64a098593abaeab330ed476a; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< b6ee49b448b539bbf09f638b57bbfb76da343764; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< e4eb329621b594a18e53f40c4021a0e18492dadb; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 17e89acda585072f5bce5852f16ddf5063c83819; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 1397005178f69365f94457f1a402835f5e498008; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 129119bb1c3dba3c47bc620a831355dbd1451c7b; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 61485a6e004eaf84d5ee4d7eb27501247ce77524; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< ac0159129e2cb99a70c4b80cfbf58d03e092dc7b (cvelist)
- Linux: 2.6.26 (cvelist)

## Technologies

Linux kernel

## 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-2026-142820. Work read-only: do not install, upgrade, delete or change anything.

Details: https://flawdb.com/CVE-2026-142820.md
Affected: Linux >= dc7d552705215ac50a0617fcf51bb9c736255b8e, < 45713e6218a0ae6e64a098593abaeab330ed476a; >= dc7d552705215ac50a0617fcf51bb9c736255b8e, < b6ee49b448b539bbf09f638b57bbfb76da343764; >= dc7d552705215ac50a0617fcf51bb9c736255b8e, < e4eb329621b594a18e53f40c4021a0e18492dadb; >= dc7d552705215ac50a0617f…
Fixed in: Linux 45713e6218a0ae6e64a098593abaeab330ed476a, Linux 17e89acda585072f5bce5852f16ddf5063c83819, Linux 1397005178f69365f94457f1a402835f5e498008, Linux 129119bb1c3dba3c47bc620a831355dbd1451c7b, Linux 61485a6e004eaf84d5ee4d7eb27501247ce77524

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-2026-142820 being exploited?

There is no confirmed exploitation: CVE-2026-142820 is not in the CISA Known Exploited Vulnerabilities catalog. No public exploit code is known.

### How serious is CVE-2026-142820?

It has no CVSS score yet. Unknown.

### Which versions are affected by CVE-2026-142820?

Linux \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 45713e6218a0ae6e64a098593abaeab330ed476a; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< b6ee49b448b539bbf09f638b57bbfb76da343764; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< e4eb329621b594a18e53f40c4021a0e18492dadb; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 17e89acda585072f5bce5852f16ddf5063c83819; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 1397005178f69365f94457f1a402835f5e498008; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 129119bb1c3dba3c47bc620a831355dbd1451c7b; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< 61485a6e004eaf84d5ee4d7eb27501247ce77524; \>= dc7d552705215ac50a0617fcf51bb9c736255b8e, \< ac0159129e2cb99a70c4b80cfbf58d03e092dc7b; Linux 2.6.26.

### Is there a fix for CVE-2026-142820?

Yes. Fixed in Linux 45713e6218a0ae6e64a098593abaeab330ed476a, Linux 17e89acda585072f5bce5852f16ddf5063c83819, Linux 1397005178f69365f94457f1a402835f5e498008, Linux 129119bb1c3dba3c47bc620a831355dbd1451c7b, Linux 61485a6e004eaf84d5ee4d7eb27501247ce77524. No fix listed yet: follow the vendor advisory.

### How do I check if I'm affected by CVE-2026-142820?

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

- other: <https://git.kernel.org/stable/c/45713e6218a0ae6e64a098593abaeab330ed476a>
- other: <https://git.kernel.org/stable/c/b6ee49b448b539bbf09f638b57bbfb76da343764>
- other: <https://git.kernel.org/stable/c/e4eb329621b594a18e53f40c4021a0e18492dadb>
- other: <https://git.kernel.org/stable/c/17e89acda585072f5bce5852f16ddf5063c83819>
- other: <https://git.kernel.org/stable/c/1397005178f69365f94457f1a402835f5e498008>
- other: <https://git.kernel.org/stable/c/129119bb1c3dba3c47bc620a831355dbd1451c7b>
- other: <https://git.kernel.org/stable/c/61485a6e004eaf84d5ee4d7eb27501247ce77524>
- other: <https://git.kernel.org/stable/c/ac0159129e2cb99a70c4b80cfbf58d03e092dc7b>

## 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-2026-142820>

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