Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-05 Thread Dave Hansen
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.



Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-05 Thread Dave Hansen
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.



Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Joerg Roedel
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



Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Joerg Roedel
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



Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Dave Hansen
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 



Re: [PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Dave Hansen
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 



[PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Joerg Roedel
From: 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.

Fixes: a4455082dc6f0 ('x86/signals: Add missing signal_compat code for x86 
features')
Cc: Dave Hansen 
Signed-off-by: Joerg Roedel 
---
 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)>si_lower;
-   compat_uptr_t upper = (unsigned 
long)>si_upper;
+   compat_uptr_t lower = (unsigned 
long)from->si_lower;
+   compat_uptr_t upper = (unsigned 
long)from->si_upper;
put_user_ex(lower, 
>si_lower);
put_user_ex(upper, 
>si_upper);
}
-- 
1.9.1



[PATCH] x86/signals: Fix lower/upper bound reporting in compat siginfo

2017-04-04 Thread Joerg Roedel
From: 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.

Fixes: a4455082dc6f0 ('x86/signals: Add missing signal_compat code for x86 
features')
Cc: Dave Hansen 
Signed-off-by: Joerg Roedel 
---
 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)>si_lower;
-   compat_uptr_t upper = (unsigned 
long)>si_upper;
+   compat_uptr_t lower = (unsigned 
long)from->si_lower;
+   compat_uptr_t upper = (unsigned 
long)from->si_upper;
put_user_ex(lower, 
>si_lower);
put_user_ex(upper, 
>si_upper);
}
-- 
1.9.1