Commit 136d9d83 authored by Juergen Gross's avatar Juergen Gross Committed by Ingo Molnar

x86/ldt: Correct LDT access in single stepping logic

Commit 37868fe1 ("x86/ldt: Make modify_ldt synchronous")
introduced a new struct ldt_struct anchored at mm->context.ldt.

convert_ip_to_linear() was changed to reflect this, but indexing
into the ldt has to be changed as the pointer is no longer void *.
Signed-off-by: default avatarJuergen Gross <jgross@suse.com>
Reviewed-by: default avatarAndy Lutomirski <luto@kernel.org>
Cc: <stable@vger.kernel.org> # On top of: 37868fe1: x86/ldt: Make modify_ldt synchronous
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: bp@suse.de
Link: http://lkml.kernel.org/r/1438848278-12906-1-git-send-email-jgross@suse.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
parent dd2384a7
...@@ -28,11 +28,11 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re ...@@ -28,11 +28,11 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
struct desc_struct *desc; struct desc_struct *desc;
unsigned long base; unsigned long base;
seg &= ~7UL; seg >>= 3;
mutex_lock(&child->mm->context.lock); mutex_lock(&child->mm->context.lock);
if (unlikely(!child->mm->context.ldt || if (unlikely(!child->mm->context.ldt ||
(seg >> 3) >= child->mm->context.ldt->size)) seg >= child->mm->context.ldt->size))
addr = -1L; /* bogus selector, access would fault */ addr = -1L; /* bogus selector, access would fault */
else { else {
desc = &child->mm->context.ldt->entries[seg]; desc = &child->mm->context.ldt->entries[seg];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment