Re: [PATCH v2 18/18] uaccess: drop maining CONFIG_SET_FS users

2022-02-24 Thread Dinh Nguyen
On 2/16/22 07:13, Arnd Bergmann wrote: From: Arnd Bergmann There are no remaining callers of set_fs(), so CONFIG_SET_FS can be removed globally, along with the thread_info field and any references to it. This turns access_ok() into a cheaper check against TASK_SIZE_MAX. With CONFIG_SET_FS

Re: [PATCH v2 13/18] uaccess: generalize access_ok()

2022-02-24 Thread Dinh Nguyen
On 2/16/22 07:13, Arnd Bergmann wrote: From: Arnd Bergmann There are many different ways that access_ok() is defined across architectures, but in the end, they all just compare against the user_addr_max() value or they accept anything. Provide one definition that works for most

Re: [PATCH v2 12/18] uaccess: fix type mismatch warnings from access_ok()

2022-02-24 Thread Dinh Nguyen
On 2/16/22 07:13, Arnd Bergmann wrote: From: Arnd Bergmann On some architectures, access_ok() does not do any argument type checking, so replacing the definition with a generic one causes a few warnings for harmless issues that were never caught before. Fix the ones that I found either

Re: [PATCH v2 02/18] uaccess: fix nios2 and microblaze get_user_8()

2022-02-24 Thread Dinh Nguyen
On 2/16/22 07:13, Arnd Bergmann wrote: From: Arnd Bergmann These two architectures implement 8-byte get_user() through a memcpy() into a four-byte variable, which won't fit. Use a temporary 64-bit variable instead here, and use a double cast the way that risc-v and openrisc do to avoid

Re: [PATCH v2 18/18] uaccess: drop maining CONFIG_SET_FS users

2022-02-24 Thread Stafford Horne
On Wed, Feb 16, 2022 at 02:13:32PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > There are no remaining callers of set_fs(), so CONFIG_SET_FS > can be removed globally, along with the thread_info field and > any references to it. > > This turns access_ok() into a cheaper check against

Re: [PATCH v2 13/18] uaccess: generalize access_ok()

2022-02-24 Thread Arnd Bergmann
On Thu, Feb 24, 2022 at 9:29 AM Stafford Horne wrote: > > - > > -#define access_ok(addr, size) > > \ > > -({ \ > > - __chk_user_ptr(addr);