kernel_optimize_test/kernel/debug/kdb
Daniel Thompson ad99b5105c kdb: Censor attempts to set PROMPT without ENABLE_MEM_READ
Currently the PROMPT variable could be abused to provoke the printf()
machinery to read outside the current stack frame. Normally this
doesn't matter becaues md is already a much better tool for reading
from memory.

However the md command can be disabled by not setting KDB_ENABLE_MEM_READ.
Let's also prevent PROMPT from being modified in these circumstances.

Whilst adding a comment to help future code reviewers we also remove
the #ifdef where PROMPT in consumed. There is no problem passing an
unused (0) to snprintf when !CONFIG_SMP.
argument

Reported-by: Wang Xiayang <xywang.sjtu@sjtu.edu.cn>
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
2020-04-01 16:59:11 +01:00
..
.gitignore
kdb_bp.c kdb: remove redundant assignment to pointer bp 2020-01-31 17:34:06 +00:00
kdb_bt.c kdb: Gid rid of implicit setting of the current task / regs 2020-01-31 17:34:00 +00:00
kdb_cmds
kdb_debugger.c kdb: Don't back trace on a cpu that didn't round up 2018-12-30 08:31:23 +00:00
kdb_io.c kdb: Use for_each_console() helper 2020-01-31 17:34:54 +00:00
kdb_keyboard.c
kdb_main.c kdb: Censor attempts to set PROMPT without ENABLE_MEM_READ 2020-04-01 16:59:11 +01:00
kdb_private.h kdb: Gid rid of implicit setting of the current task / regs 2020-01-31 17:34:00 +00:00
kdb_support.c kdb: kdb_support: replace strcpy() by strscpy() 2019-05-02 13:42:01 +01:00
Makefile kdb: Get rid of broken attempt to print CCVERSION in kdb summary 2019-05-12 09:50:43 +01:00