Bug 2295918 - kernel: kdb: Fix buffer overflow during tab-complete
Summary: kernel: kdb: Fix buffer overflow during tab-complete
Keywords:
Status: CLOSED DUPLICATE of bug 2296056
Alias: None
Product: Security Response
Classification: Other
Component: vulnerability
Version: unspecified
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
Assignee: Product Security DevOps Team
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2024-07-05 09:22 UTC by OSIDB Bzimport
Modified: 2024-07-12 13:04 UTC (History)
0 users

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2024-07-05 21:18:15 UTC
Embargoed:


Attachments (Terms of Use)

Description OSIDB Bzimport 2024-07-05 09:22:18 UTC
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.

Comment 1 Mauro Matteo Cascella 2024-07-05 21:18:15 UTC

*** This bug has been marked as a duplicate of bug 2296056 ***


Note You need to log in before you can comment on or make changes to this bug.