lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Mon, 24 Oct 2016 21:08:17 +0200
From:   Michal Hocko <mhocko@...nel.org>
To:     Johannes Weiner <hannes@...xchg.org>
Cc:     Stable tree <stable@...r.kernel.org>, linux-mm@...ck.org,
        LKML <linux-kernel@...r.kernel.org>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Jan Kara <jack@...e.cz>
Subject: Re: [Stable 4.4 - NEEDS REVIEW - 2/3] mm: filemap: don't plant
 shadow entries without radix tree node

On Mon 24-10-16 14:56:00, Johannes Weiner wrote:
> Hi Michal,
> 
> On Mon, Oct 24, 2016 at 05:26:04PM +0200, Michal Hocko wrote:
> > @@ -155,44 +155,27 @@ static void page_cache_tree_delete(struct address_space *mapping,
> >  				   struct page *page, void *shadow)
> >  {
> >  	struct radix_tree_node *node;
> > -	unsigned long index;
> > -	unsigned int offset;
> > -	unsigned int tag;
> >  	void **slot;
> >  
> >  	VM_BUG_ON(!PageLocked(page));
> >  
> >  	__radix_tree_lookup(&mapping->page_tree, page->index, &node, &slot);
> >  
> > -	if (shadow) {
> > -		mapping->nrshadows++;
> > -		/*
> > -		 * Make sure the nrshadows update is committed before
> > -		 * the nrpages update so that final truncate racing
> > -		 * with reclaim does not see both counters 0 at the
> > -		 * same time and miss a shadow entry.
> > -		 */
> > -		smp_wmb();
> > -	}
> > -	mapping->nrpages--;
> > +	radix_tree_clear_tags(&mapping->page_tree, node, slot);
> >  
> >  	if (!node) {
> > -		/* Clear direct pointer tags in root node */
> > -		mapping->page_tree.gfp_mask &= __GFP_BITS_MASK;
> > -		radix_tree_replace_slot(slot, shadow);
> > -		return;
> > -	}
> 
> There is no need to include the refactoring of the tag clearing in the
> stable backport. I already sent a simpler backport of this patch for
> 4.4 to Greg, attached here for reference:

I do not see this in 4.4 so maybe it's fallen through cracks. Yours
definitely looks easier and I will use it. I will post all 4 patches for
inclusion for stable tomorrow unless something else pops out.

Thanks for the review again!
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ