summaryrefslogtreecommitdiff
path: root/lib/test_overflow.c
diff options
context:
space:
mode:
authorDaniel Thompson <daniel.thompson@linaro.org>2020-02-13 15:16:40 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 14:34:32 -0800
commitcf6260a34d28492fc300923b59acfa4a4c5029ad (patch)
tree9683bcd8dc6e8e07044afeb5933c8b3d6d367dea /lib/test_overflow.c
parent36b6db699c03f951979e591564ed7a16f86772f2 (diff)
kdb: Censor attempts to set PROMPT without ENABLE_MEM_READ
[ Upstream commit ad99b5105c0823ff02126497f4366e6a8009453e ] 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> Stable-dep-of: 4f41d30cd6dc ("kdb: Fix a potential buffer overflow in kdb_local()") Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'lib/test_overflow.c')
0 files changed, 0 insertions, 0 deletions