mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] x86/ldt: correct ldt access in single stepping logic
@ 2015-08-06  8:04 Juergen Gross
  2015-08-06 18:37 ` Andy Lutomirski
  2015-08-09 10:22 ` [tip:x86/urgent] x86/ldt: Correct LDT " tip-bot for Juergen Gross
  0 siblings, 2 replies; 3+ messages in thread
From: Juergen Gross @ 2015-08-06  8:04 UTC (permalink / raw)
  To: luto, bp, x86, hpa, mingo, tglx, linux-kernel; +Cc: Juergen Gross, stable

Commit 37868fe113ff ("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 *.

Cc: <stable@vger.kernel.org> # 37868fe113ff: x86/ldt: Make modify_ldt synchronous
Signed-off-by: Juergen Gross <jgross@suse.com>
---
 arch/x86/kernel/step.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
index 6273324..0ccb53a 100644
--- a/arch/x86/kernel/step.c
+++ b/arch/x86/kernel/step.c
@@ -28,11 +28,11 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
 		struct desc_struct *desc;
 		unsigned long base;
 
-		seg &= ~7UL;
+		seg >>= 3;
 
 		mutex_lock(&child->mm->context.lock);
 		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 */
 		else {
 			desc = &child->mm->context.ldt->entries[seg];
-- 
2.1.4


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

* Re: [PATCH] x86/ldt: correct ldt access in single stepping logic
  2015-08-06  8:04 [PATCH] x86/ldt: correct ldt access in single stepping logic Juergen Gross
@ 2015-08-06 18:37 ` Andy Lutomirski
  2015-08-09 10:22 ` [tip:x86/urgent] x86/ldt: Correct LDT " tip-bot for Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: Andy Lutomirski @ 2015-08-06 18:37 UTC (permalink / raw)
  To: Juergen Gross
  Cc: Andrew Lutomirski, Borislav Petkov, X86 ML, H. Peter Anvin,
	Ingo Molnar, Thomas Gleixner, linux-kernel, stable

On Thu, Aug 6, 2015 at 1:04 AM, Juergen Gross <jgross@suse.com> wrote:
> Commit 37868fe113ff ("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 *.

Good catch.

Reviewed-by: Andy Lutomirski <luto@kernel.org>

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

* [tip:x86/urgent] x86/ldt: Correct LDT access in single stepping logic
  2015-08-06  8:04 [PATCH] x86/ldt: correct ldt access in single stepping logic Juergen Gross
  2015-08-06 18:37 ` Andy Lutomirski
@ 2015-08-09 10:22 ` tip-bot for Juergen Gross
  1 sibling, 0 replies; 3+ messages in thread
From: tip-bot for Juergen Gross @ 2015-08-09 10:22 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: linux-kernel, hpa, tglx, peterz, jgross, torvalds, luto, mingo

Commit-ID:  136d9d83c07c5e30ac49fc83b27e8c4842f108fc
Gitweb:     http://git.kernel.org/tip/136d9d83c07c5e30ac49fc83b27e8c4842f108fc
Author:     Juergen Gross <jgross@suse.com>
AuthorDate: Thu, 6 Aug 2015 10:04:38 +0200
Committer:  Ingo Molnar <mingo@kernel.org>
CommitDate: Sat, 8 Aug 2015 10:20:45 +0200

x86/ldt: Correct LDT access in single stepping logic

Commit 37868fe113ff ("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: Juergen Gross <jgross@suse.com>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: <stable@vger.kernel.org> # On top of: 37868fe113ff: 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.com
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
 arch/x86/kernel/step.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/x86/kernel/step.c b/arch/x86/kernel/step.c
index 6273324..0ccb53a 100644
--- a/arch/x86/kernel/step.c
+++ b/arch/x86/kernel/step.c
@@ -28,11 +28,11 @@ unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *re
 		struct desc_struct *desc;
 		unsigned long base;
 
-		seg &= ~7UL;
+		seg >>= 3;
 
 		mutex_lock(&child->mm->context.lock);
 		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 */
 		else {
 			desc = &child->mm->context.ldt->entries[seg];

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

end of thread, other threads:[~2015-08-09 10:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-06  8:04 [PATCH] x86/ldt: correct ldt access in single stepping logic Juergen Gross
2015-08-06 18:37 ` Andy Lutomirski
2015-08-09 10:22 ` [tip:x86/urgent] x86/ldt: Correct LDT " tip-bot for Juergen Gross

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome