kernel_samsung_a53x/kernel/debug/kdb
Daniel Thompson c8cf50e572 kdb: Use format-strings rather than '\0' injection in kdb_read()
commit 09b35989421dfd5573f0b4683c7700a7483c71f9 upstream.

Currently when kdb_read() needs to reposition the cursor it uses copy and
paste code that works by injecting an '\0' at the cursor position before
delivering a carriage-return and reprinting the line (which stops at the
'\0').

Tidy up the code by hoisting the copy and paste code into an appropriately
named function. Additionally let's replace the '\0' injection with a
proper field width parameter so that the string will be abridged during
formatting instead.

Cc: stable@vger.kernel.org # Not a bug fix but it is needed for later bug fixes
Tested-by: Justin Stitt <justinstitt@google.com>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20240424-kgdb_read_refactor-v3-2-f236dbe9828d@linaro.org
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-11-19 12:27:18 +01:00
..
kdb_bp.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_bt.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_cmds Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_debugger.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_io.c kdb: Use format-strings rather than '\0' injection in kdb_read() 2024-11-19 12:27:18 +01:00
kdb_keyboard.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_main.c kdb: Fix a potential buffer overflow in kdb_local() 2024-11-18 12:12:51 +01:00
kdb_private.h Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
kdb_support.c Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00
Makefile Import A536BXXU9EXDC 2024-06-15 16:02:09 -03:00