Re: [PATCH 1/2] kernel.h: use parentheses around argument in u64_to_user_ptr()

2019-03-28 Thread Mukesh Ojha
On 3/29/2019 2:53 AM, Jann Horn wrote: Use parentheses around uses of the argument in u64_to_user_ptr() to ensure that the cast doesn't apply to part of the argument. There are existing uses of the macro of the form `u64_to_user_ptr(A + B)`, which expands to `(void __user *)(uintptr_t)A + B` (

[PATCH 1/2] kernel.h: use parentheses around argument in u64_to_user_ptr()

2019-03-28 Thread Jann Horn
Use parentheses around uses of the argument in u64_to_user_ptr() to ensure that the cast doesn't apply to part of the argument. There are existing uses of the macro of the form `u64_to_user_ptr(A + B)`, which expands to `(void __user *)(uintptr_t)A + B` (the cast applies to the first operand of th