Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread Linus Torvalds
On Thu, Aug 20, 2015 at 1:59 AM, yalin wang wrote: > - > - n = copy_to_user(buffer, (char *)start, tsz); > + if ((start + tsz < tsz) || > + (start + tsz) > TASK_SIZE) > +

Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread yalin wang
> On Aug 20, 2015, at 17:58, Frans Klaver wrote: > > On Thu, Aug 20, 2015 at 10:59 AM, yalin wang wrote: >> the copy_to_user() here expect can fix the fault on both kernel and >> user address, this is not true on other platforms except x86, >> change to user copy_in_user() so that can detect

Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread Frans Klaver
On Thu, Aug 20, 2015 at 10:59 AM, yalin wang wrote: > the copy_to_user() here expect can fix the fault on both kernel and > user address, this is not true on other platforms except x86, > change to user copy_in_user() so that can detect the page fault, > work as expected. Could you rephrase this

[RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread yalin wang
the copy_to_user() here expect can fix the fault on both kernel and user address, this is not true on other platforms except x86, change to user copy_in_user() so that can detect the page fault, work as expected. Signed-off-by: yalin wang --- fs/proc/kcore.c | 8 ++-- 1 file changed, 6

Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread Frans Klaver
On Thu, Aug 20, 2015 at 10:59 AM, yalin wang yalin.wang2...@gmail.com wrote: the copy_to_user() here expect can fix the fault on both kernel and user address, this is not true on other platforms except x86, change to user copy_in_user() so that can detect the page fault, work as expected.

[RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread yalin wang
the copy_to_user() here expect can fix the fault on both kernel and user address, this is not true on other platforms except x86, change to user copy_in_user() so that can detect the page fault, work as expected. Signed-off-by: yalin wang yalin.wang2...@gmail.com --- fs/proc/kcore.c | 8 ++--

Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread yalin wang
On Aug 20, 2015, at 17:58, Frans Klaver franskla...@gmail.com wrote: On Thu, Aug 20, 2015 at 10:59 AM, yalin wang yalin.wang2...@gmail.com wrote: the copy_to_user() here expect can fix the fault on both kernel and user address, this is not true on other platforms except x86, change to user

Re: [RFC] fs/kcore: change copy_to_user to copy_in_user

2015-08-20 Thread Linus Torvalds
On Thu, Aug 20, 2015 at 1:59 AM, yalin wang yalin.wang2...@gmail.com wrote: - - n = copy_to_user(buffer, (char *)start, tsz); + if ((start + tsz tsz) || + (start + tsz) TASK_SIZE) +