Skip to content

Commit

Permalink
Merge tag 's390-5.2-4' of git://git.kernel.org/pub/scm/linux/kernel/g…
Browse files Browse the repository at this point in the history
…it/s390/linux

Pull s390 fixes from Heiko Carstens:

 - fix stack unwinder: the stack unwinder rework has on off-by-one bug
   which prevents following stack backchains over more than one context
   (e.g. irq -> process).

 - fix address space detection in exception handler: if user space
   switches to access register mode, which is not supported anymore, the
   exception handler may resolve to the wrong address space.

* tag 's390-5.2-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
  s390/unwind: correct stack switching during unwind
  s390/mm: fix address space detection in exception handling
  • Loading branch information
Linus Torvalds committed Jun 8, 2019
2 parents d0cc617 + 0ab0d7a commit 3d4645b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/s390/include/asm/stacktrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ static inline bool on_stack(struct stack_info *info,
return false;
if (addr + len < addr)
return false;
return addr >= info->begin && addr + len < info->end;
return addr >= info->begin && addr + len <= info->end;
}

static inline unsigned long get_stack_pointer(struct task_struct *task,
Expand Down
5 changes: 4 additions & 1 deletion arch/s390/mm/fault.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ static inline int notify_page_fault(struct pt_regs *regs)

/*
* Find out which address space caused the exception.
* Access register mode is impossible, ignore space == 3.
*/
static enum fault_type get_fault_type(struct pt_regs *regs)
{
Expand All @@ -108,6 +107,10 @@ static enum fault_type get_fault_type(struct pt_regs *regs)
}
return VDSO_FAULT;
}
if (trans_exc_code == 1) {
/* access register mode, not used in the kernel */
return USER_FAULT;
}
/* home space exception -> access via kernel ASCE */
return KERNEL_FAULT;
}
Expand Down

0 comments on commit 3d4645b

Please sign in to comment.