x86/signals: Fix lower/upper bound reporting in compat siginfo
PATCH 1/1 x86/signals: Fix lower/upper bound reporting in compat siginfo
From: Joerg Roedel <[email protected]>
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.
--- arch/x86/kernel/signal_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/signal_compat.c +2 -2
@@ -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); }
Signature · 1 line
1.9.1
Quoted 4 lines · Joerg Roedel
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.
Quoted 7 lines · Dave Hansen
Quoted 4 lines · Joerg Roedel
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
Dave Hansen
maintainerQuoted 9 lines · Joerg Roedel
Quoted 7 lines · Dave Hansen
Quoted 4 lines · Joerg Roedel
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.
Quoted 8 lines
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_fillevaluates 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.
tip-bot for Joerg Roedel
merge botx86/signals: Fix lower/upper bound reporting in compat siginfo
Commit-ID: cfac6dfa42bddfa9711b20d486e521d1a41ab09f Gitweb: http://git.kernel.org/tip/cfac6dfa42bddfa9711b20d486e521d1a41ab09f Author: Joerg Roedel <[email protected]> AuthorDate: Tue, 4 Apr 2017 18:15:01 +0200 Committer: Ingo Molnar <[email protected]> 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.
--- arch/x86/kernel/signal_compat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/x86/kernel/signal_compat.c +2 -2
@@ -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); }