Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1616181 > unrolled thread
| Started by | Joerg Roedel <joro@8bytes.org> |
|---|---|
| First post | 2017-04-04 18:20 +0200 |
| Last post | 2017-04-05 11:10 +0200 |
| Articles | 5 — 3 participants |
Back to article view | Back to linux.kernel
[PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo Joerg Roedel <joro@8bytes.org> - 2017-04-04 18:20 +0200
Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo Dave Hansen <dave.hansen@linux.intel.com> - 2017-04-04 19:00 +0200
Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo Joerg Roedel <joro@8bytes.org> - 2017-04-05 00:00 +0200
Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo Dave Hansen <dave.hansen@linux.intel.com> - 2017-04-06 00:50 +0200
[tip:x86/urgent] x86/signals: Fix lower/upper bound reporting in compat siginfo tip-bot for Joerg Roedel <tipbot@zytor.com> - 2017-04-05 11:10 +0200
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-04-04 18:20 +0200 |
| Subject | [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo |
| Message-ID | <tszlv-7cC-3@gated-at.bofh.it> |
From: Joerg Roedel <jroedel@suse.de>
Put the right values from the original siginfo into the
userspace compat-siginfo.
This fixes the 32-bit mpx tabletest on a 64-bit kernel.
Fixes: a4455082dc6f0 ('x86/signals: Add missing signal_compat code for x86 features')
Cc: Dave Hansen <dave.hansen@linux.intel.com>
Signed-off-by: Joerg Roedel <jroedel@suse.de>
---
arch/x86/kernel/signal_compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
index ec1f756..71beb28 100644
--- a/arch/x86/kernel/signal_compat.c
+++ b/arch/x86/kernel/signal_compat.c
@@ -151,8 +151,8 @@ int __copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from,
if (from->si_signo == SIGSEGV) {
if (from->si_code == SEGV_BNDERR) {
- compat_uptr_t lower = (unsigned long)&to->si_lower;
- compat_uptr_t upper = (unsigned long)&to->si_upper;
+ compat_uptr_t lower = (unsigned long)from->si_lower;
+ compat_uptr_t upper = (unsigned long)from->si_upper;
put_user_ex(lower, &to->si_lower);
put_user_ex(upper, &to->si_upper);
}
--
1.9.1
[toc] | [next] | [standalone]
| From | Dave Hansen <dave.hansen@linux.intel.com> |
|---|---|
| Date | 2017-04-04 19:00 +0200 |
| Subject | Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo |
| Message-ID | <tszYe-7uN-23@gated-at.bofh.it> |
| In reply to | #1616181 |
On 04/04/2017 09:15 AM, Joerg Roedel wrote: > Put the right values from the original siginfo into the > userspace compat-siginfo. > > This fixes the 32-bit mpx tabletest on a 64-bit kernel. Ugh, thanks for finding that. Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
[toc] | [prev] | [next] | [standalone]
| From | Joerg Roedel <joro@8bytes.org> |
|---|---|
| Date | 2017-04-05 00:00 +0200 |
| Subject | Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo |
| Message-ID | <tsEEy-24C-7@gated-at.bofh.it> |
| In reply to | #1616211 |
On Tue, Apr 04, 2017 at 09:56:45AM -0700, Dave Hansen wrote: > On 04/04/2017 09:15 AM, Joerg Roedel wrote: > > Put the right values from the original siginfo into the > > userspace compat-siginfo. > > > > This fixes the 32-bit mpx tabletest on a 64-bit kernel. > > Ugh, thanks for finding that. Yeah, I was also looking at the vaddrexhaust test, but is that supposed to work? It does pretty weird things at least, on 64 bit the function effectivly does nothing because nr_to_fill evaluates to 0 there, and on 32 bit it gets a (probably #BF) exception which is not caught, so that the test fails. I am a bit confused, but maybe I just didn't stare long enough at it :-) Hope you can sched some light on it. Joerg
[toc] | [prev] | [next] | [standalone]
| From | Dave Hansen <dave.hansen@linux.intel.com> |
|---|---|
| Date | 2017-04-06 00:50 +0200 |
| Subject | Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo |
| Message-ID | <tt1Ut-7G-5@gated-at.bofh.it> |
| In reply to | #1616399 |
On 04/04/2017 02:53 PM, Joerg Roedel wrote: > On Tue, Apr 04, 2017 at 09:56:45AM -0700, Dave Hansen wrote: >> On 04/04/2017 09:15 AM, Joerg Roedel wrote: >>> Put the right values from the original siginfo into the >>> userspace compat-siginfo. >>> >>> This fixes the 32-bit mpx tabletest on a 64-bit kernel. >> >> Ugh, thanks for finding that. > > Yeah, I was also looking at the vaddrexhaust test, but is that supposed > to work? It does pretty weird things at least, on 64 bit the function > effectivly does nothing because nr_to_fill evaluates to 0 there, and on > 32 bit it gets a (probably #BF) exception which is not caught, so that > the test fails. > > I am a bit confused, but maybe I just didn't stare long enough at it :-) > Hope you can sched some light on it. That code can probably just get removed from the tests. I haven't run it in a while and it's probably not worth refreshing.
[toc] | [prev] | [next] | [standalone]
| From | tip-bot for Joerg Roedel <tipbot@zytor.com> |
|---|---|
| Date | 2017-04-05 11:10 +0200 |
| Subject | [tip:x86/urgent] x86/signals: Fix lower/upper bound reporting in compat siginfo |
| Message-ID | <tsP6X-FR-55@gated-at.bofh.it> |
| In reply to | #1616181 |
Commit-ID: cfac6dfa42bddfa9711b20d486e521d1a41ab09f
Gitweb: http://git.kernel.org/tip/cfac6dfa42bddfa9711b20d486e521d1a41ab09f
Author: Joerg Roedel <jroedel@suse.de>
AuthorDate: Tue, 4 Apr 2017 18:15:01 +0200
Committer: Ingo Molnar <mingo@kernel.org>
CommitDate: Wed, 5 Apr 2017 10:16:43 +0200
x86/signals: Fix lower/upper bound reporting in compat siginfo
Put the right values from the original siginfo into the
userspace compat-siginfo.
This fixes the 32-bit MPX "tabletest" testcase on 64-bit kernels.
Signed-off-by: Joerg Roedel <jroedel@suse.de>
Acked-by: Dave Hansen <dave.hansen@linux.intel.com>
Cc: <stable@vger.kernel.org> # v4.8+
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Borislav Petkov <bp@suse.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: Dmitry Safonov <0x7f454c46@gmail.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Fixes: a4455082dc6f0 ('x86/signals: Add missing signal_compat code for x86 features')
Link: http://lkml.kernel.org/r/1491322501-5054-1-git-send-email-joro@8bytes.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
---
arch/x86/kernel/signal_compat.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/signal_compat.c b/arch/x86/kernel/signal_compat.c
index ec1f756..71beb28 100644
--- a/arch/x86/kernel/signal_compat.c
+++ b/arch/x86/kernel/signal_compat.c
@@ -151,8 +151,8 @@ int __copy_siginfo_to_user32(compat_siginfo_t __user *to, const siginfo_t *from,
if (from->si_signo == SIGSEGV) {
if (from->si_code == SEGV_BNDERR) {
- compat_uptr_t lower = (unsigned long)&to->si_lower;
- compat_uptr_t upper = (unsigned long)&to->si_upper;
+ compat_uptr_t lower = (unsigned long)from->si_lower;
+ compat_uptr_t upper = (unsigned long)from->si_upper;
put_user_ex(lower, &to->si_lower);
put_user_ex(upper, &to->si_upper);
}
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web