linux-yocto/kernel/debug/kdb
Daniel Thompson f76fd94ae6 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:39:59 +02:00
..
.gitignore .gitignore: add SPDX License Identifier 2020-03-25 11:50:48 +01:00
kdb_bp.c kdb: Rename members of struct kdbtab_t 2021-07-27 17:05:06 +01:00
kdb_bt.c kdb: Adopt scheduler's task classification 2021-11-18 19:17:06 +01:00
kdb_cmds
kdb_debugger.c kdb: Get rid of custom debug heap allocator 2021-07-27 14:46:11 +01:00
kdb_io.c kdb: Use format-specifiers rather than memset() for padding in kdb_read() 2024-06-16 13:39:59 +02:00
kdb_keyboard.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
kdb_main.c kdb: Fix a potential buffer overflow in kdb_local() 2024-01-25 14:52:54 -08:00
kdb_private.h kdb: Adopt scheduler's task classification 2021-11-18 19:17:06 +01:00
kdb_support.c kdb: Fix the putarea helper function 2022-04-08 14:23:51 +02:00
Makefile kdb: Get rid of broken attempt to print CCVERSION in kdb summary 2019-05-12 09:50:43 +01:00