Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-06-02 Thread Pingfan Liu
On Sat, Jun 1, 2019 at 1:06 AM John Hubbard wrote: > > On 5/31/19 4:05 AM, Pingfan Liu wrote: > > On Fri, May 31, 2019 at 7:21 AM John Hubbard wrote: > >> On 5/30/19 2:47 PM, Ira Weiny wrote: > >>> On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > >> [...] > >> Rather lightly

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-06-02 Thread Pingfan Liu
On Sat, Jun 1, 2019 at 1:12 AM Ira Weiny wrote: > > On Fri, May 31, 2019 at 07:05:27PM +0800, Pingfan Liu wrote: > > On Fri, May 31, 2019 at 7:21 AM John Hubbard wrote: > > > > > > > > > Rather lightly tested...I've compile-tested with CONFIG_CMA and > > > !CONFIG_CMA, > > > and boot tested

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-31 Thread Ira Weiny
On Fri, May 31, 2019 at 07:05:27PM +0800, Pingfan Liu wrote: > On Fri, May 31, 2019 at 7:21 AM John Hubbard wrote: > > > > > > Rather lightly tested...I've compile-tested with CONFIG_CMA and !CONFIG_CMA, > > and boot tested with CONFIG_CMA, but could use a second set of eyes on > > whether > >

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-31 Thread Pingfan Liu
On Fri, May 31, 2019 at 7:21 AM John Hubbard wrote: > > On 5/30/19 2:47 PM, Ira Weiny wrote: > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > [...] > >> +for (j = i; j < nr; j++) > >> +put_page(pages[j]); > > > >

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-31 Thread Pingfan Liu
On Fri, May 31, 2019 at 7:52 AM Ira Weiny wrote: > > On Thu, May 30, 2019 at 04:21:19PM -0700, John Hubbard wrote: > > On 5/30/19 2:47 PM, Ira Weiny wrote: > > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > > [...] > > >> + for (j = i; j < nr; j++) > >

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-31 Thread Pingfan Liu
On Fri, May 31, 2019 at 5:46 AM Ira Weiny wrote: > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > > As for FOLL_LONGTERM, it is checked in the slow path > > __gup_longterm_unlocked(). But it is not checked in the fast path, which > > means a possible leak of CMA page to longterm

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-30 Thread Ira Weiny
On Thu, May 30, 2019 at 04:21:19PM -0700, John Hubbard wrote: > On 5/30/19 2:47 PM, Ira Weiny wrote: > > On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > [...] > >> + for (j = i; j < nr; j++) > >> + put_page(pages[j]); > > >

Re: [PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-30 Thread Ira Weiny
On Thu, May 30, 2019 at 06:54:04AM +0800, Pingfan Liu wrote: > As for FOLL_LONGTERM, it is checked in the slow path > __gup_longterm_unlocked(). But it is not checked in the fast path, which > means a possible leak of CMA page to longterm pinned requirement through > this crack. > > Place a check

[PATCH] mm/gup: fix omission of check on FOLL_LONGTERM in get_user_pages_fast()

2019-05-29 Thread Pingfan Liu
As for FOLL_LONGTERM, it is checked in the slow path __gup_longterm_unlocked(). But it is not checked in the fast path, which means a possible leak of CMA page to longterm pinned requirement through this crack. Place a check in the fast path. Signed-off-by: Pingfan Liu Cc: Ira Weiny Cc: Andrew