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] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 15 Jun 2010 14:23:50 +0100
From:	Mel Gorman <mel@....ul.ie>
To:	Nick Piggin <npiggin@...e.de>
Cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Rik van Riel <riel@...hat.com>,
	Dave Chinner <david@...morbit.com>,
	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	linux-mm@...ck.org, Chris Mason <chris.mason@...cle.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Christoph Hellwig <hch@...radead.org>,
	KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
Subject: Re: [patch] mm: vmscan fix mapping use after free

On Tue, Jun 15, 2010 at 03:43:44PM +1000, Nick Piggin wrote:
> On Tue, Jun 15, 2010 at 03:12:42PM +1000, Nick Piggin wrote:
> > > Once that page is unlocked, we can't touch *mapping - its inode can be
> > > concurrently reclaimed.  Although I guess the technique in
> > > handle_write_error() can be reused.
> > 
> > Nasty. That guy needs to be using lock_page_nosync().
> --
> 
> Need lock_page_nosync here because we have no reference to the mapping when
> taking the page lock.
> 
> Signed-off-by: Nick Piggin <npiggin@...e.de>
> 

Thanks, I've picked this up and merged it into the series and removed
the "hand grenade" comment.

> ---
>  mm/vmscan.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6/mm/vmscan.c
> ===================================================================
> --- linux-2.6.orig/mm/vmscan.c
> +++ linux-2.6/mm/vmscan.c
> @@ -296,7 +296,7 @@ static int may_write_to_queue(struct bac
>  static void handle_write_error(struct address_space *mapping,
>  				struct page *page, int error)
>  {
> -	lock_page(page);
> +	lock_page_nosync(page);
>  	if (page_mapping(page) == mapping)
>  		mapping_set_error(mapping, error);
>  	unlock_page(page);
> 

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ