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

2022-02-18 Thread Andy Lutomirski
On Fri, Feb 18, 2022 at 1:30 AM David Laight wrote: > > From: Andy Lutomirski > > Sent: 17 February 2022 19:15 > ... > > This isn't actually optimal. On x86, TASK_SIZE_MAX is a bizarre > > constant that has a very specific value to work around a bug^Wdesign > > error^Wfeature of Intel CPUs. TASK

RE: [PATCH v2 05/18] x86: remove __range_not_ok()

2022-02-18 Thread David Laight
From: Christoph Hellwig > Sent: 18 February 2022 06:29 ... > > > diff --git a/arch/x86/kernel/stacktrace.c b/arch/x86/kernel/stacktrace.c > > index 15b058eefc4e..ee117fcf46ed 100644 > > --- a/arch/x86/kernel/stacktrace.c > > +++ b/arch/x86/kernel/stacktrace.c > > @@ -90,7 +90,7 @@ copy_stack_frame

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

2022-02-18 Thread Sergey Matyukevich
Hi Arnd, > 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 gone, so drop al

Re: [PATCH v2 00/18] clean up asm/uaccess.h, kill set_fs for good

2022-02-18 Thread Christophe Leroy
Le 18/02/2022 à 02:50, Al Viro a écrit : > On Thu, Feb 17, 2022 at 07:20:11AM +, Christophe Leroy wrote: > >> And we have also >> user_access_begin()/user_read_access_begin()/user_write_access_begin() >> which call access_ok() then do the real work. Could be made generic with >> call to some

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

2022-02-18 Thread David Laight
From: Andy Lutomirski > Sent: 17 February 2022 19:15 ... > This isn't actually optimal. On x86, TASK_SIZE_MAX is a bizarre > constant that has a very specific value to work around a bug^Wdesign > error^Wfeature of Intel CPUs. TASK_SIZE_MAX is the maximum address at > which userspace is permitted

Re: [PATCH v2 10/18] m68k: fix access_ok for coldfire

2022-02-18 Thread Arnd Bergmann
On Fri, Feb 18, 2022 at 10:00 AM Geert Uytterhoeven wrote: > > /* We let the MMU do all checking */ > > -static inline int access_ok(const void __user *addr, > > +static inline int access_ok(const void __user *ptr, > > unsigned long size) > > { > > + unsigned lo

Re: [PATCH v2 00/18] clean up asm/uaccess.h, kill set_fs for good

2022-02-18 Thread Arnd Bergmann
n Fri, Feb 18, 2022 at 3:21 AM Al Viro wrote: > > On Thu, Feb 17, 2022 at 08:49:59AM +0100, Arnd Bergmann wrote: > > > Same here: architectures can already provide a __put_user_fn() > > and __get_user_fn(), to get the generic versions of the interface, > > but few architectures use that. You can a

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

2022-02-18 Thread Geert Uytterhoeven
On Wed, Feb 16, 2022 at 2:17 PM 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

Re: [PATCH v2 10/18] m68k: fix access_ok for coldfire

2022-02-18 Thread Geert Uytterhoeven
Hi Arnd, On Wed, Feb 16, 2022 at 2:17 PM Arnd Bergmann wrote: > From: Arnd Bergmann > > While most m68k platforms use separate address spaces for user > and kernel space, at least coldfire does not, and the other > ones have a TASK_SIZE that is less than the entire 4GB address > range. > > Using

Re: [PATCH v2 08/18] uaccess: add generic __{get,put}_kernel_nofault

2022-02-18 Thread Geert Uytterhoeven
On Wed, Feb 16, 2022 at 2:17 PM Arnd Bergmann wrote: > From: Arnd Bergmann > > Nine architectures are still missing __{get,put}_kernel_nofault: > alpha, ia64, microblaze, nds32, nios2, openrisc, sh, sparc32, xtensa. > > Add a generic version that lets everything use the normal > copy_{from,to}_ke