Re: [RFC 2/4] lib/strncpy_from_user: Remove redundant user space pointer range check

2020-01-15 Thread Vineet Gupta
On 1/15/20 6:42 AM, Andrey Konovalov wrote: >> - max_addr = user_addr_max(); >> - src_addr = (unsigned long)untagged_addr(src); > > If you end up changing this code, you need to keep the untagged_addr() > logic, otherwise this breaks arm64 tagged address ABI [1]. It is moot point now,

Re: [RFC 2/4] lib/strncpy_from_user: Remove redundant user space pointer range check

2020-01-14 Thread Al Viro
On Tue, Jan 14, 2020 at 01:22:07PM -0800, Linus Torvalds wrote: > The fact is, copying a string from user space is *very* different from > copying a fixed number of bytes, and that whole dance with > > max_addr = user_addr_max(); > > is absolutely required and necessary. > > You

Re: [RFC 2/4] lib/strncpy_from_user: Remove redundant user space pointer range check

2020-01-14 Thread Vineet Gupta
On 1/14/20 1:22 PM, Linus Torvalds wrote: > On Tue, Jan 14, 2020 at 12:09 PM Vineet Gupta > wrote: >> >> This came up when switching ARC to word-at-a-time interface and using >> generic/optimized strncpy_from_user >> >> It seems the existing code checks for user buffer/string range multiple >>

Re: [RFC 2/4] lib/strncpy_from_user: Remove redundant user space pointer range check

2020-01-14 Thread Linus Torvalds
On Tue, Jan 14, 2020 at 12:09 PM Vineet Gupta wrote: > > This came up when switching ARC to word-at-a-time interface and using > generic/optimized strncpy_from_user > > It seems the existing code checks for user buffer/string range multiple > times and one of tem cn be avoided. NO! DO NOT DO