Thread (50 messages) 50 messages, 5 authors, 2021-02-02

Re: [PATCH 2/2] futex, x86/mce: Avoid double machine checks

From: Peter Zijlstra <peterz@infradead.org>
Date: 2021-01-08 23:16:14
Also in: linux-edac, lkml

On Fri, Jan 08, 2021 at 11:08:58PM +0000, Luck, Tony wrote:
quoted
I think this is horrid; why can't we have it return something different
then -EFAULT instead?
I did consider this ... but it appears that architectures aren't unified in the
return value from get_user()
But surely none are currently returning -EMEMERR or whatever name we
come up with.
Here's another function involved in the futex call chain leading to this:

static int get_futex_value_locked(u32 *dest, u32 __user *from)
{
        int ret;

        pagefault_disable();
        ret = __get_user(*dest, from);
        pagefault_enable();

        return ret ? -EFAULT : 0;
}

It seems like the expectation here is just "zero or not" and we
don't care what the "not" value is ... just turn it into -EFAULT.
Yeah, saw that, but that should be trivially fixable I'm thinking.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help