Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756803Ab0DFQdR (ORCPT ); Tue, 6 Apr 2010 12:33:17 -0400 Received: from smtp1.linux-foundation.org ([140.211.169.13]:34355 "EHLO smtp1.linux-foundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751669Ab0DFQdL (ORCPT ); Tue, 6 Apr 2010 12:33:11 -0400 Date: Tue, 6 Apr 2010 09:28:58 -0700 (PDT) From: Linus Torvalds To: Minchan Kim cc: Rik van Riel , KOSAKI Motohiro , Borislav Petkov , Andrew Morton , Linux Kernel Mailing List , Lee Schermerhorn , Nick Piggin , Andrea Arcangeli , Hugh Dickins Subject: Re: Ugly rmap NULL ptr deref oopsie on hibernate (was Linux 2.6.34-rc3) In-Reply-To: <1270571019.1814.163.camel@barrios-desktop> Message-ID: References: <20100402175937.GA19690@liondog.tnic> <20100406173754.7E5A.A69D9226@jp.fujitsu.com> <4BBB475A.7070002@redhat.com> <1270568096.1814.145.camel@barrios-desktop> <1270571019.1814.163.camel@barrios-desktop> User-Agent: Alpine 2.00 (LFD 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 970 Lines: 29 On Wed, 7 Apr 2010, Minchan Kim wrote: > > > > However, that made me look at the PAGE_MIGRATION case. That seems to be > > just broken. It's doing that page_anon_vma() + spin_lock without holding > > any RCU locks, so there is no guarantee that anon_vma there is at all > > valid. > > FYI, recently there is a patch about migration case. > http://lkml.org/lkml/2010/4/2/145 No, I'm talking about rmap_walk_anon(): anon_vma = page_anon_vma(page); if (!anon_vma) return ret; spin_lock(&anon_vma->lock); which seems to be simply buggy. The anon_vma may not exist any more, because an RCU event might have really freed the page between looking it up and locking it. Linus -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/