linux-stable/kernel/debug
Daniel Thompson ea303a7af8 kdb: Use format-specifiers rather than memset() for padding in kdb_read()
commit c9b51ddb66 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>
2024-06-16 13:47:44 +02:00
..
kdb kdb: Use format-specifiers rather than memset() for padding in kdb_read() 2024-06-16 13:47:44 +02:00
Makefile
debug_core.c kgdb: Flush console before entering kgdb on panic 2023-11-28 17:19:47 +00:00
debug_core.h kdb: Fix stack crawling on 'running' CPUs that aren't the master 2019-10-10 16:28:48 +01:00
gdbstub.c kernel: debug: Convert to SPDX identifier 2021-09-06 14:31:11 +01:00