Ubuntu-focal-kernel/kernel/debug/kdb
Daniel Thompson a5824e8393 kdb: Use format-specifiers rather than memset() for padding in kdb_read()
BugLink: https://bugs.launchpad.net/bugs/2071668

commit c9b51ddb66b1d96e4d364c088da0f1dfb004c574 upstream.

Currently when the current line should be removed from the display
kdb_read() uses memset() to fill a temporary buffer with spaces.
The problem is not that this could be trivially implemented using a
format string rather than open coding it. The real problem is that
it is possible, on systems with a long kdb_prompt_str, to write past
the end of the tmpbuffer.

Happily, as mentioned above, this can be trivially implemented using a
format string. Make it so!

Cc: stable@vger.kernel.org
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Tested-by: Justin Stitt <justinstitt@google.com>
Link: https://lore.kernel.org/r/20240424-kgdb_read_refactor-v3-5-f236dbe9828d@linaro.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Portia Stephens <portia.stephens@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
2024-07-05 10:52:03 +02:00
..
.gitignore
Makefile
kdb_bp.c
kdb_bt.c
kdb_cmds
kdb_debugger.c
kdb_io.c kdb: Use format-specifiers rather than memset() for padding in kdb_read() 2024-07-05 10:52:03 +02:00
kdb_keyboard.c
kdb_main.c kdb: Fix a potential buffer overflow in kdb_local() 2024-02-29 15:23:41 +01:00
kdb_private.h
kdb_support.c