stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] MIPS: Minor EVA related unwind fixes
@ 2015-12-04 22:25 James Hogan
  2015-12-04 22:25 ` [PATCH 1/2] MIPS: Don't unwind to user mode with EVA James Hogan
  2015-12-04 22:25 ` [PATCH 2/2] MIPS: Avoid using unwind_stack() with usermode James Hogan
  0 siblings, 2 replies; 7+ messages in thread
From: James Hogan @ 2015-12-04 22:25 UTC (permalink / raw)
  To: Ralf Baechle, linux-mips; +Cc: James Hogan, Leonid Yegoshin, stable

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 <Leonid.Yegoshin@imgtec.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: <stable@vger.kernel.org> # 3.15+
-- 
2.4.10


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-12-07 19:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-04 22:25 [PATCH 0/2] MIPS: Minor EVA related unwind fixes James Hogan
2015-12-04 22:25 ` [PATCH 1/2] MIPS: Don't unwind to user mode with EVA James Hogan
2015-12-05  0:21   ` Leonid Yegoshin
2015-12-07  8:43     ` James Hogan
2015-12-07 19:45       ` Leonid Yegoshin
2015-12-04 22:25 ` [PATCH 2/2] MIPS: Avoid using unwind_stack() with usermode James Hogan
2015-12-05  0:21   ` Leonid Yegoshin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).