aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/vmlinux-gdb.py
diff options
context:
space:
mode:
authorPaul Burton <[email protected]>2018-12-20 17:45:43 +0000
committerPaul Burton <[email protected]>2018-12-20 10:00:01 -0800
commitadcc81f148d733b7e8e641300c5590a2cdc13bf3 (patch)
tree95ae4624fa8b2011aa09d5ac9de40f2eef609110 /scripts/gdb/vmlinux-gdb.py
parent41e486f4f66d3e646fedd60469bc60e73662de50 (diff)
MIPS: math-emu: Write-protect delay slot emulation pages
Mapping the delay slot emulation page as both writeable & executable presents a security risk, in that if an exploit can write to & jump into the page then it can be used as an easy way to execute arbitrary code. Prevent this by mapping the page read-only for userland, and using access_process_vm() with the FOLL_FORCE flag to write to it from mips_dsemul(). This will likely be less efficient due to copy_to_user_page() performing cache maintenance on a whole page, rather than a single line as in the previous use of flush_cache_sigtramp(). However this delay slot emulation code ought not to be running in any performance critical paths anyway so this isn't really a problem, and we can probably do better in copy_to_user_page() anyway in future. A major advantage of this approach is that the fix is small & simple to backport to stable kernels. Reported-by: Andy Lutomirski <[email protected]> Signed-off-by: Paul Burton <[email protected]> Fixes: 432c6bacbd0c ("MIPS: Use per-mm page to execute branch delay slot instructions") Cc: [email protected] # v4.8+ Cc: [email protected] Cc: [email protected] Cc: Rich Felker <[email protected]> Cc: David Daney <[email protected]>
Diffstat (limited to 'scripts/gdb/vmlinux-gdb.py')
0 files changed, 0 insertions, 0 deletions