Skip to content

MIPS: Minor EVA related unwind fixes

James Hogan linux-mips stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest2 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2MIPS: Don't unwind to user mode with EVAarch/mips/kernel/process.c+1 -13 replies
2/2MIPS: Avoid using unwind_stack() with usermodearch/mips/kernel/traps.c+1 -11 reply

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/2] MIPS: Minor EVA related unwind fixes

Here are a couple of minor EVA related stack unwind fixes, which prevent the use of unwind_stack() (which unwinds using kallsyms knowledge of where kernel functions begin and end) to unwind userland code, particularly where the PC is a valid kernel address, which could happen innocently with EVA due to the overlapped user/kernel address spaces.

Note that unwind_stack() is defensive enough that it shouldn't do any harm, so I've only tagged stable back to v3.15, when EVA was added and it could conceivably happen under normal operation.

A rough audit shows no other uses of __kernel_text_address() in relation to possibly user mode register contexts.

The first patch fixes unwind_stack() itself not to unwind through an exception frame if it represents the user register context, preventing itself being called with that context next.

The second patch fixes show_backtrace() to fall back to raw backtrace for user mode register contexts, rather than using unwind_stack(). This is used on certain faults which can be triggered by userland (namely unaligned accesses when reporting is enabled in debugfs).

James Hogan (2):
MIPS: Don't unwind to user mode with EVA
MIPS: Avoid using unwind_stack() with usermode

 arch/mips/kernel/process.c | 2 +-
 arch/mips/kernel/traps.c   | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
Cc Leonid Yegoshin <[email protected]>
Cc Ralf Baechle <[email protected]>
Cc <[email protected]> # 3.15+
Signature · 1 line
2.4.10