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

2022-02-17 Thread Arnd Bergmann
On Fri, Feb 18, 2022 at 7:34 AM Christoph Hellwig wrote: > > > +#include > > Instead of the asm-generic games, shouldn't we just define access_ok in > if not already defined by the architecture? I tried, but couldn't actually make it work because asm/uaccess.h tends to contain inline functions

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

2022-02-17 Thread Arnd Bergmann
On Fri, Feb 18, 2022 at 7:28 AM Christoph Hellwig wrote: > On Wed, Feb 16, 2022 at 02:13:19PM +0100, Arnd Bergmann wrote: > > --- a/arch/x86/events/core.c > > +++ b/arch/x86/events/core.c > > @@ -2794,7 +2794,7 @@ perf_callchain_kernel(struct perf_callchain_entry_ctx > > *entry, struct pt_regs

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

2022-02-17 Thread Christoph Hellwig
On Wed, Feb 16, 2022 at 02:13:19PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The __range_not_ok() helper is an x86 (and sparc64) specific interface > that does roughly the same thing as __access_ok(), but with different > calling conventions. > > Change this to use the normal

Re: [PATCH v2 07/18] nios2: drop access_ok() check from __put_user()

2022-02-17 Thread Christoph Hellwig
On Wed, Feb 16, 2022 at 02:13:21PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > Unlike other architectures, the nios2 version of __put_user() has an > extra check for access_ok(), preventing it from being used to implement > __put_kernel_nofault(). > > Split up put_user() along the

Re: [PATCH v2 06/18] x86: use more conventional access_ok() definition

2022-02-17 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH v2 14/18] lib/test_lockup: fix kernel pointer check for separate address spaces

2022-02-17 Thread Christoph Hellwig
On Wed, Feb 16, 2022 at 02:13:28PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > test_kernel_ptr() uses access_ok() to figure out if a given address > points to user space instead of kernel space. However on architectures > that set CONFIG_ALTERNATE_USER_ADDRESS_SPACE, a pointer can be

Re: [PATCH v2 16/18] sh: remove CONFIG_SET_FS support

2022-02-17 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

2022-02-17 Thread Arnd Bergmann
On Fri, Feb 18, 2022 at 7:37 AM Christoph Hellwig wrote: > > s/maining/remaining/ ? > > Or maybe rather: > > uaccess: remove CONFIG_SET_FS > > because it is all gone now. > > > With CONFIG_SET_FS gone, so drop all remaining references to > > set_fs()/get_fs(), mm_segment_t and uaccess_kernel(). >

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

2022-02-17 Thread Arnd Bergmann
On Thu, Feb 17, 2022 at 8:15 PM Andy Lutomirski wrote: > > On Wed, Feb 16, 2022 at 5:19 AM 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 > >

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

2022-02-17 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

Re: [PATCH v2 03/18] nds32: fix access_ok() checks in get/put_user

2022-02-17 Thread Christoph Hellwig
On Wed, Feb 16, 2022 at 02:13:17PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > The get_user()/put_user() functions are meant to check for > access_ok(), while the __get_user()/__put_user() functions > don't. > > This broke in 4.19 for nds32, when it gained an extraneous > check in

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

2022-02-17 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

2022-02-17 Thread Christoph Hellwig
Looks good, Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

2022-02-17 Thread Christoph Hellwig
Looks good: Reviewed-by: Christoph Hellwig ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-snps-arc

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

2022-02-17 Thread Christoph Hellwig
> +#include Instead of the asm-generic games, shouldn't we just define access_ok in if not already defined by the architecture? ___ linux-snps-arc mailing list linux-snps-arc@lists.infradead.org

Re: [PATCH v2 14/18] lib/test_lockup: fix kernel pointer check for separate address spaces

2022-02-17 Thread Arnd Bergmann
On Fri, Feb 18, 2022 at 7:35 AM Christoph Hellwig wrote: > > On Wed, Feb 16, 2022 at 02:13:28PM +0100, Arnd Bergmann wrote: > > From: Arnd Bergmann > > > > test_kernel_ptr() uses access_ok() to figure out if a given address > > points to user space instead of kernel space. However on

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

2022-02-17 Thread Christoph Hellwig
s/maining/remaining/ ? Or maybe rather: uaccess: remove CONFIG_SET_FS because it is all gone now. > With CONFIG_SET_FS gone, so drop all remaining references to > set_fs()/get_fs(), mm_segment_t and uaccess_kernel(). And this sentence does not parse.

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

2022-02-17 Thread Al Viro
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 arch specific __user_access_begin() and

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

2022-02-17 Thread Al Viro
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 actually get all the interfaces > by just providing

Re: [RFC PATCH 0/3] arc: remove CONFIG_SET_FS

2022-02-17 Thread Vineet Gupta
IIUC it makes sense to drop this patch series from your for-next branch. These changes have been superseded by generic approach posted by Arnd Bergmann, see: https://lore.kernel.org/linux-arch/CAHk-=whXYWoP6of7js=f4zov62on97mnfrsvrwhy75wogm6...@mail.gmail.com/T/#t I tested patches by Arnd on

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

2022-02-17 Thread Arnd Bergmann
On Wed, Feb 16, 2022 at 2:13 PM Arnd Bergmann wrote: > > From: Arnd Bergmann > > Christoph Hellwig and a few others spent a huge effort on removing > set_fs() from most of the important architectures, but about half the > other architectures were never completed even though most of them don't >

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

2022-02-17 Thread Eric W. Biederman
Arnd Bergmann writes: > 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-17 Thread Andy Lutomirski
On Wed, Feb 16, 2022 at 5:19 AM 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