linux-stable/kernel/debug/kdb
Daniel Thompson c1cb81429d kdb: Fix the putarea helper function
Currently kdb_putarea_size() uses copy_from_kernel_nofault() to write *to*
arbitrary kernel memory. This is obviously wrong and means the memory
modify ('mm') command is a serious risk to debugger stability: if we poke
to a bad address we'll double-fault and lose our debug session.

Fix this the (very) obvious way.

Note that there are two Fixes: tags because the API was renamed and this
patch will only trivially backport as far as the rename (and this is
probably enough). Nevertheless Christoph's rename did not introduce this
problem so I wanted to record that!

Fixes: fe557319aa ("maccess: rename probe_kernel_{read,write} to copy_{from,to}_kernel_nofault")
Fixes: 5d5314d679 ("kdb: core for kgdb back end (1 of 2)")
Signed-off-by: Daniel Thompson <daniel.thompson@linaro.org>
Reviewed-by: Douglas Anderson <dianders@chromium.org>
Link: https://lore.kernel.org/r/20220128144055.207267-1-daniel.thompson@linaro.org
2022-03-24 16:39:47 +00: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-03 17:21:37 +00:00
kdb_cmds kdb: cleanup unused variables missed in the original kdb merge 2011-08-01 13:23:58 -05:00
kdb_debugger.c kdb: Get rid of custom debug heap allocator 2021-07-27 14:46:11 +01:00
kdb_io.c kdb: Fix pager search for multi-line strings 2020-10-01 14:44:08 +01:00
kdb_keyboard.c treewide: Use fallthrough pseudo-keyword 2020-08-23 17:36:59 -05:00
kdb_main.c kdb: Adopt scheduler's task classification 2021-11-03 17:21:37 +00:00
kdb_private.h kdb: Adopt scheduler's task classification 2021-11-03 17:21:37 +00:00
kdb_support.c kdb: Fix the putarea helper function 2022-03-24 16:39:47 +00:00
Makefile kdb: Get rid of broken attempt to print CCVERSION in kdb summary 2019-05-12 09:50:43 +01:00