Re: [PATCH 1/4] parisc: Drop strnlen_user() in favour of generic version

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/8/21 11:26 PM, Arnd Bergmann wrote:
On Wed, Sep 8, 2021 at 10:44 PM Helge Deller <deller@xxxxxx> wrote:

As suggested by Arnd Bergmann, drop the parisc version of
strnlen_user() and switch to the generic version.

The strnlen_user() removal looks good,

Acked-by: Arnd Bergmann <arnd@xxxxxxxx>

Good.

user_addr_max() was wrong too, fix it by using TASK_SIZE.

Not sure about this part though:

  /*
   * Complex access routines -- macros
   */
-#define user_addr_max() (~0UL)
+#define user_addr_max() (uaccess_kernel() ? ~0UL : TASK_SIZE)

I noticed that our user_addr_max() was actually wrong.
It's used in the generic strnlen_user() so fixing it seemed appropriate.

We are getting very close to completely removing set_fs()/get_fs(),
uaccess_kernel() and some related bits from the kernel, so I think
it would be better to the other way here and finish off removing
CONFIG_SET_FS from parisc.

I think this will also simplify your asm/uaccess.h a lot, in particular
since it has separate address spaces for __get_user() and
__get_kernel_nofault(), and without set_fs() you can leave out
the runtime conditional to switch between them.

That's a good idea and should probably be done.
Do you have some pointers where to start, e.g. initial commits from other arches ?

Helge




[Index of Archives]     [Linux SoC]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux