[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <ddd1bd1c-6a22-84d0-caf0-ce71c732f71b@infradead.org>
Date: Tue, 30 Jun 2020 08:29:11 -0700
From: Randy Dunlap <rdunlap@...radead.org>
To: Peter Zijlstra <peterz@...radead.org>
Cc: akpm@...ux-foundation.org, broonie@...nel.org, mhocko@...e.cz,
sfr@...b.auug.org.au, linux-next@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, mm-commits@...r.kernel.org,
Josh Poimboeuf <jpoimboe@...hat.com>, viro@...iv.linux.org.uk
Subject: Re: mmotm 2020-06-25-20-36 uploaded (objtool warning)
On 6/30/20 2:59 AM, Peter Zijlstra wrote:
> On Fri, Jun 26, 2020 at 04:35:08PM -0700, Randy Dunlap wrote:
>> arch/x86/kernel/sys_ia32.o: warning: objtool: cp_stat64()+0x57: call to new_encode_dev() with UACCESS enabled
>
> That's c120f3b81ede ("x86: switch cp_stat64() to unsafe_put_user()").
>
> Where __put_user() made sure evaluate 'x' before doing
> __uaccess_begin(), the new code has no such choice.
>
> The simplest fix is probably something like this.
>
Acked-by: Randy Dunlap <rdunlap@...radead.org> # build-tested
Thanks.
> ---
> include/linux/kdev_t.h | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/include/linux/kdev_t.h b/include/linux/kdev_t.h
> index 85b5151911cf..a840ffef7c19 100644
> --- a/include/linux/kdev_t.h
> +++ b/include/linux/kdev_t.h
> @@ -36,7 +36,7 @@ static inline dev_t old_decode_dev(u16 val)
> return MKDEV((val >> 8) & 255, val & 255);
> }
>
> -static inline u32 new_encode_dev(dev_t dev)
> +static __always_inline u32 new_encode_dev(dev_t dev)
> {
> unsigned major = MAJOR(dev);
> unsigned minor = MINOR(dev);
> @@ -50,7 +50,7 @@ static inline dev_t new_decode_dev(u32 dev)
> return MKDEV(major, minor);
> }
>
> -static inline u64 huge_encode_dev(dev_t dev)
> +static __always_inline u64 huge_encode_dev(dev_t dev)
> {
> return new_encode_dev(dev);
> }
>
--
~Randy
Powered by blists - more mailing lists