Re: [PATCH 1/1] futex: remove duplicated code and fix UB
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: Thomas Gleixner <tglx@xxxxxxxxxxxxx>, Will Deacon <will.deacon@xxxxxxx>
- Subject: Re: [PATCH 1/1] futex: remove duplicated code and fix UB
- From: Jiri Slaby <jslaby@xxxxxxx>
- Date: Mon, 26 Jun 2017 14:02:31 +0200
- Cc: mingo@xxxxxxxxxx, peterz@xxxxxxxxxxxxx, dvhart@xxxxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, Richard Henderson <rth@xxxxxxxxxxx>, Ivan Kokshaysky <ink@xxxxxxxxxxxxxxxxxxxx>, Matt Turner <mattst88@xxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxxxx>, Catalin Marinas <catalin.marinas@xxxxxxx>, Richard Kuo <rkuo@xxxxxxxxxxxxxx>, Tony Luck <tony.luck@xxxxxxxxx>, Fenghua Yu <fenghua.yu@xxxxxxxxx>, Michal Simek <monstr@xxxxxxxxx>, Ralf Baechle <ralf@xxxxxxxxxxxxxx>, Jonas Bonn <jonas@xxxxxxxxxxxx>, Stefan Kristiansson <stefan.kristiansson@xxxxxxxxxxxxx>, Stafford Horne <shorne@xxxxxxxxx>, "James E.J. Bottomley" <jejb@xxxxxxxxxxxxxxxx>, Helge Deller <deller@xxxxxx>, Benjamin Herrenschmidt <benh@xxxxxxxxxxxxxxxxxxx>, Paul Mackerras <paulus@xxxxxxxxx>, Martin Schwidefsky <schwidefsky@xxxxxxxxxx>, Yoshinori Sato <ysato@xxxxxxxxxxxxxxxxxxxx>, Rich Felker <dalias@xxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>, "H. Peter Anvin" <hpa@xxxxxxxxx>, Chris Zankel <chris@xxxxxxxxxx>, Max Filippov <jcmvbkbc@xxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, x86@xxxxxxxxxx, linux-alpha@xxxxxxxxxxxxxxx, linux-snps-arc@xxxxxxxxxxxxxxxxxxx, linux-arm-kernel@xxxxxxxxxxxxxxxxxxx, linux-hexagon@xxxxxxxxxxxxxxx, linux-ia64@xxxxxxxxxxxxxxx, linux-mips@xxxxxxxxxxxxxx, openrisc@xxxxxxxxxxxxxxxxxxxx, linux-parisc@xxxxxxxxxxxxxxx, linuxppc-dev@xxxxxxxxxxxxxxxx, linux-s390@xxxxxxxxxxxxxxx, linux-sh@xxxxxxxxxxxxxxx, sparclinux@xxxxxxxxxxxxxxx, linux-xtensa@xxxxxxxxxxxxxxxx, linux-arch@xxxxxxxxxxxxxxx
- In-reply-to: <alpine.DEB.2.20.1706230017520.2221@nanos>
- References: <20170621115318.2781-1-jslaby@suse.cz> <alpine.DEB.2.20.1706230017520.2221@nanos>
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.0
On 06/23/2017, 09:51 AM, Thomas Gleixner wrote:
> On Wed, 21 Jun 2017, Jiri Slaby wrote:
>> diff --git a/arch/arm64/include/asm/futex.h b/arch/arm64/include/asm/futex.h
>> index f32b42e8725d..5bb2fd4674e7 100644
>> --- a/arch/arm64/include/asm/futex.h
>> +++ b/arch/arm64/include/asm/futex.h
>> @@ -48,20 +48,10 @@ do { \
>> } while (0)
>>
>> static inline int
>> -futex_atomic_op_inuser(unsigned int encoded_op, u32 __user *uaddr)
>
> That unsigned int seems to be a change from the arm64 tree in next. It's
> not upstream and it'll cause a (easy to resolve) conflict.
Ugh, I thought the arm64 is in upstream already. Note that this patch
just takes what is in this arm64 fix and makes it effective for all
architectures. So I will wait with v2 until it merges upstream.
So, Will, will you incorporate Thomas' comments into your arm64 fix?
...
> Yes, we probably can't change that anymore, but at least we should make it
> very explicit and add a comment to that effect.
Something like this or do you want a comment yet?
unsigned int op = (encoded_op & 0x70000000) >> 28;
unsigned int cmp = (encoded_op & 0x0f000000) >> 24;
int oparg = sign_extend32((encoded_op & 0x00fff000) >> 12, 12);
int cmparg = sign_extend32(encoded_op & 0x00000fff, 12);
thanks,
--
js
suse labs
--
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]