CVE-2026-142819: kgdb: Fix buffer overflow in the qRcmd packet handler

Published Dec 3, 2026
·
Updated

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

kgdb: Fix buffer overflow in the qRcmd packet handler

gdbcmdquery() decodes the hex payload of a qRcmd packet (the GDB "monitor" command passthrough to kdb) into remcomoutbuffer and hands it to kdbparse(). It sizes the decode with strlen() of the payload:

int len = strlen(remcominbuffer + 6); ... kgdbhex2mem(remcominbuffer + 6, remcomoutbuffer, len); len = len / 2;

kgdbhex2mem() takes count as the number of bytes to produce and decodes them in place at buf, reading and writing 2 count bytes there. len here is the hex character count, twice the decoded size, so the decode runs over 2 len bytes at remcominbuffer + 6, off the end of the buffer. On x86 BUFMAX is 1024, so a 256-byte monitor command (512 hex characters) overruns remcominbuffer during the in-place decode:

BUG: KASAN: global-out-of-bounds in kgdbhex2mem+0x131/0x160 Read of size 1 at addr ffffffff8765ef05 by task sh/1 ... kgdbhex2mem+0x131/0x160 gdbserialstub+0x16d4/0x3170 kgdbcpuenter+0xb68/0x1520 ... The buggy address belongs to the variable: remcominbuffer+0x405/0x420

Halve len before the call so kgdbhex2mem() gets the decoded byte count. It then reads the len hex characters already in remcominbuffer and writes len / 2 bytes, all inside the buffer, and remcomoutbuffer holds the same command as before.

Affected Software

12 affected componentsFixes available
Linux Linux kernel
linux/kernel>=2.6.35<5.10.275
5.10.275
linux/kernel>=5.11.0<5.15.226
5.15.226
linux/kernel>=5.16.0<6.1.193
6.1.193
linux/kernel>=6.2.0<6.6.163
6.6.163
linux/kernel>=6.7.0<6.12.117
6.12.117
linux/kernel>=6.13.0<6.18.63
6.18.63
linux/kernel>=6.19.0<7.3.4
7.3.4
debian/linux*
debian/linux<6.12.117-1
6.12.117-1
debian/linux<7.3.4-1
7.3.4-1
debian/linux<=6.1.176-1, <=6.1.192-3
6.12.117-17.3.4-1

Remediation

Recommended actions to resolve this vulnerability, in priority order.

  1. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.10.275
  2. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 5.15.226
  3. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.1.193
  4. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.6.163
  5. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.12.117
  6. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 6.18.63
  7. Upgrade

    Upgrade linux/Kernel to a version that resolves this vulnerability.

    Fixed in 7.3.4
  8. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.117-1
  9. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 7.3.4-1
  10. Upgrade

    Upgrade debian/linux to a version that resolves this vulnerability.

    Fixed in 6.12.117-1Fixed in 7.3.4-1
  11. Compensating control

    In gdb_cmd_query(), halve len (len = len / 2) before calling kgdb_hex2mem(), so it receives the decoded byte count.

Event History

Dec 3, 2026
CVE Published
via MITRE·03:20 AM
Data Sourced
via MITRE·03:20 AM
Description
Data Sourced
via OSV·03:20 AM
DescriptionAffected Software
Data Sourced
via NVD·04:18 AM
Description

Frequently Asked Questions

1

What access does an attacker need to trigger this issue?

The attacker needs to send a GDB remote qRcmd packet, which carries a GDB "monitor" command that kgdb passes through to kdb. Systems are exposed where that kgdb debugging interface is reachable by the attacker.

2

What input size is known to cause the overflow?

On x86, where BUFMAX is 1024, a 256-byte monitor command encoded as 512 hexadecimal characters overruns remcom_in_buffer during decoding. The flawed handler passes the hexadecimal character count as a decoded-byte count, causing kgdb_hex2mem() to process too much input.

3

How can I identify a likely occurrence on an affected system?

A KASAN-enabled kernel may report a global-out-of-bounds read in kgdb_hex2mem(), with the stack including gdb_serial_stub and kgdb_cpu_enter. The report may identify remcom_in_buffer as the overrun buffer.

4

What should be verified in a fix?

Verify that the qRcmd handler halves the hexadecimal payload length before calling kgdb_hex2mem(), so the function receives the number of decoded bytes rather than the number of hex characters. The listed stable-kernel references contain fixes for this issue.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203