CVE-2024-39480

kdb: Fix buffer overflow during tab-complete

State
Published
Severity
8.4 High
Published
Jul 5, 2024
Updated
Aug 5, 2026
Reserved
Jun 25, 2024

Read the record on cve.org

Description

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

kdb: Fix buffer overflow during tab-complete

Currently, when the user attempts symbol completion with the Tab key, kdb will use strncpy() to insert the completed symbol into the command buffer. Unfortunately it passes the size of the source buffer rather than the destination to strncpy() with predictably horrible results. Most obviously if the command buffer is already full but cp, the cursor position, is in the middle of the buffer, then we will write past the end of the supplied buffer.

Fix this by replacing the dubious strncpy() calls with memmove()/memcpy() calls plus explicit boundary checks to make sure we have enough space before we start moving characters around.

Scores

CVSSScoreVectorSource
3.18.4 HighCVSS:3.1/AV:L/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:HLinux
3.17.8 HighCVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:HCISA-ADP

Weaknesses

  • CWE-121 Stack-based Buffer Overflow

Affected Products

ProductVersions
LinuxLinux
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before fb824a99e148ff272a53d71d84122728b5f00992Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before ddd2972d8e2dee3b33e8121669d55def59f0be8aAffected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before cfdc2fa4db57503bc6d3817240547c8ddc55fa96Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before f636a40834d22e5e3fc748f060211879c056cd33Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before 33d9c814652b971461d1e30bead6792851c209e7Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before 107e825cc448b7834b31e8b1b3cf0f57426d46d5Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before f694da720dcf795dc3eb97bf76d220213f76aaa7Affected
  • 5d5314d6795f3c1c0f415348ff8c51f7de042b77 to before e9730744bf3af04cda23799029342aa3cddbc454Affected
LinuxLinux
  • 2.6.35Affected
  • before 2.6.35Not affected
  • 4.19.316 through 4.19.*Not affected
  • 5.4.278 through 5.4.*Not affected
  • 5.10.219 through 5.10.*Not affected
  • 5.15.161 through 5.15.*Not affected
  • 6.1.94 through 6.1.*Not affected
  • 6.6.34 through 6.6.*Not affected
  • 6.9.5 through 6.9.*Not affected
  • 6.10 and laterNot affected

References

Every record here comes from the CVE Program’s CVE List. © 1999–2026 The MITRE Corporation. CVE is a registered trademark of The MITRE Corporation. The records are reproduced under the CVE Program terms of use.