CVE-2026-142820
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 versions
Linux kernel versions
2.6.26
and later are affected. Fixed in
5.10.275,
5.15.226,
6.1.193,
6.6.163,
6.12.117,
6.18.63,
7.3.4,
7.4-rc1
and their respective stable series.
References
8 totalFrequently asked questions
-
What is CVE-2026-142820?
CVE-2026-142820 is a unscored severity Linux kernel vulnerability . It affects Linux kernel versions from 2.6.26 onward and has been patched in 5.10.275, 5.15.226, 6.1.193 and others. CVE-2026-142820 has not been confirmed as actively exploited and is not listed in the CISA KEV catalog.
-
Is there a patch available for CVE-2026-142820?
Yes. CVE-2026-142820 has been patched. Fixed versions include 5.10.275, 5.15.226, 6.1.193 and others. If you are running Linux kernel 2.6.26 or later up to the fix versions, apply the relevant patch for your kernel branch.
-
Is CVE-2026-142820 actively exploited?
No. CVE-2026-142820 has not been confirmed as actively exploited. It is not listed in the CISA Known Exploited Vulnerabilities (KEV) catalog.