Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1201539 > unrolled thread
| Started by | Juergen Gross <jgross@suse.com> |
|---|---|
| First post | 2015-08-06 10:10 +0200 |
| Last post | 2015-08-09 12:30 +0200 |
| Articles | 3 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] x86/ldt: correct ldt access in single stepping logic Juergen Gross <jgross@suse.com> - 2015-08-06 10:10 +0200
Re: [PATCH] x86/ldt: correct ldt access in single stepping logic Andy Lutomirski <luto@amacapital.net> - 2015-08-06 20:40 +0200
[tip:x86/urgent] x86/ldt: Correct LDT access in single stepping logic tip-bot for Juergen Gross <tipbot@zytor.com> - 2015-08-09 12:30 +0200
| From | Juergen Gross <jgross@suse.com> |
|---|---|
| Date | 2015-08-06 10:10 +0200 |
| Subject | [PATCH] x86/ldt: correct ldt access in single stepping logic |
| Message-ID | <pUops-2Ym-13@gated-at.bofh.it> |
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
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [next] | [standalone]
| From | Andy Lutomirski <luto@amacapital.net> |
|---|---|
| Date | 2015-08-06 20:40 +0200 |
| Message-ID | <pUyf8-oA-23@gated-at.bofh.it> |
| In reply to | #1201539 |
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>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Juergen Gross <tipbot@zytor.com> |
|---|---|
| Date | 2015-08-09 12:30 +0200 |
| Subject | [tip:x86/urgent] x86/ldt: Correct LDT access in single stepping logic |
| Message-ID | <pVw1A-38Q-33@gated-at.bofh.it> |
| In reply to | #1201539 |
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];
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web