Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-20 Thread Michal Hocko
On Sun 19-06-16 23:35:43, Michal Hocko wrote: > On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h > > > index 349557825428..b1f314fca3c8 100644 > > > ---

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-20 Thread Michal Hocko
On Sun 19-06-16 23:35:43, Michal Hocko wrote: > On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > > diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h > > > index 349557825428..b1f314fca3c8 100644 > > > ---

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-19 Thread Michal Hocko
On Sun 19-06-16 23:35:43, Michal Hocko wrote: > On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > > /* > > > + * A safe variant of __get_user for for use_mm() users to have a > > > + * gurantee that the address space

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-19 Thread Michal Hocko
On Sun 19-06-16 23:35:43, Michal Hocko wrote: > On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > > /* > > > + * A safe variant of __get_user for for use_mm() users to have a > > > + * gurantee that the address space

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-19 Thread Michal Hocko
On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > It seems that vhost usage would suffer from this problem because > > it reads from the userspace to get (status) flags and makes some > > decisions based on the read value.

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-19 Thread Michal Hocko
On Sat 18-06-16 03:09:02, Michael S. Tsirkin wrote: > On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: [...] > > It seems that vhost usage would suffer from this problem because > > it reads from the userspace to get (status) flags and makes some > > decisions based on the read value.

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-17 Thread Michael S. Tsirkin
On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: > From: Michal Hocko > > vhost driver relies on copy_from_user/get_user from a kernel thread. > This makes it impossible to reap the memory of an oom victim which > shares mm with the vhost kernel thread because it

Re: [RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-17 Thread Michael S. Tsirkin
On Fri, Jun 17, 2016 at 11:00:17AM +0200, Michal Hocko wrote: > From: Michal Hocko > > vhost driver relies on copy_from_user/get_user from a kernel thread. > This makes it impossible to reap the memory of an oom victim which > shares mm with the vhost kernel thread because it could see a zero >

[RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-17 Thread Michal Hocko
From: Michal Hocko vhost driver relies on copy_from_user/get_user from a kernel thread. This makes it impossible to reap the memory of an oom victim which shares mm with the vhost kernel thread because it could see a zero page unexpectedly and theoretically make an incorrect

[RFC PATCH] vhost, mm: make sure that oom_reaper doesn't reap memory read by vhost

2016-06-17 Thread Michal Hocko
From: Michal Hocko vhost driver relies on copy_from_user/get_user from a kernel thread. This makes it impossible to reap the memory of an oom victim which shares mm with the vhost kernel thread because it could see a zero page unexpectedly and theoretically make an incorrect decision visible