Return-Path: Received: from mailapp01.imgtec.com ([195.59.15.196]:63867 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751164AbbLDWZM (ORCPT ); Fri, 4 Dec 2015 17:25:12 -0500 From: James Hogan To: Ralf Baechle , CC: James Hogan , Leonid Yegoshin , Subject: [PATCH 0/2] MIPS: Minor EVA related unwind fixes Date: Fri, 4 Dec 2015 22:25:00 +0000 Message-ID: <1449267902-28674-1-git-send-email-james.hogan@imgtec.com> MIME-Version: 1.0 Content-Type: text/plain Sender: stable-owner@vger.kernel.org List-ID: 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 Cc: Ralf Baechle Cc: linux-mips@linux-mips.org Cc: # 3.15+ -- 2.4.10