Re: [PATCH v7 2/6] uaccess: Add non-pagefault user-space read functions

2019-05-09 Thread Masami Hiramatsu
Hi Ingo, On Thu, 9 May 2019 11:14:08 +0200 Ingo Molnar wrote: > * Masami Hiramatsu wrote: > > > +static __always_inline long > > +probe_read_common(void *dst, const void __user *src, size_t size) > > +{ > > + long ret; > > + > > + pagefault_disable(); > > + ret =

Re: [PATCH v7 2/6] uaccess: Add non-pagefault user-space read functions

2019-05-09 Thread Ingo Molnar
* Masami Hiramatsu wrote: > +static __always_inline long > +probe_read_common(void *dst, const void __user *src, size_t size) > +{ > + long ret; > + > + pagefault_disable(); > + ret = __copy_from_user_inatomic(dst, src, size); > + pagefault_enable(); > + > + return ret ?

[PATCH v7 2/6] uaccess: Add non-pagefault user-space read functions

2019-05-08 Thread Masami Hiramatsu
Add probe_user_read(), strncpy_from_unsafe_user() and strnlen_unsafe_user() which allows caller to access user-space in IRQ context. Current probe_kernel_read() and strncpy_from_unsafe() are not available for user-space memory, because it sets KERNEL_DS while accessing data. On some arch, user