Re: [PATCH stable-4.4 1/2] mm: check the return value of lookup_page_ext for all call sites

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 05-12-17 16:16:35, Ben Hutchings wrote:
> On Wed, 2017-11-22 at 13:09 +0100, Michal Hocko wrote:
> > From: Yang Shi <yang.shi@xxxxxxxxxx>
> > 
> > commit f86e4271978bd93db466d6a95dad4b0fdcdb04f6 upstream.
> > 
> > Per the discussion with Joonsoo Kim [1], we need check the return value
> > of lookup_page_ext() for all call sites since it might return NULL in
> > some cases, although it is unlikely, i.e.  memory hotplug.
> > 
> > Tested with ltp with "page_owner=0".
> [...]
> > --- a/mm/debug-pagealloc.c
> > +++ b/mm/debug-pagealloc.c
> > @@ -34,6 +34,8 @@ static inline void set_page_poison(struct page
> > *page)
> >  	struct page_ext *page_ext;
> >  
> >  	page_ext = lookup_page_ext(page);
> > +	if (page_ext)
> > +		return;
> 
> This, and the other checks added to debug-pagealloc.c, are reversed. 
> (This is specific to the 4.4 backport - in the upstream version these
> functions are in mm/page_poison.c and were patched correctly.)

Yes, I've sent a fixup and Greg has queued it up as 0208fabf7256245125fbabf03207a0da4000ea2d
-- 
Michal Hocko
SUSE Labs



[Index of Archives]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]