From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx148.postini.com [74.125.245.148]) by kanga.kvack.org (Postfix) with SMTP id 811B96B0044 for ; Tue, 6 Nov 2012 03:24:50 -0500 (EST) Received: by mail-vc0-f169.google.com with SMTP id fl17so218396vcb.14 for ; Tue, 06 Nov 2012 00:24:49 -0800 (PST) MIME-Version: 1.0 In-Reply-To: References: <508086DA.3010600@oracle.com> <5089A05E.7040000@gmail.com> Date: Tue, 6 Nov 2012 00:24:49 -0800 Message-ID: Subject: Re: mm: NULL ptr deref in anon_vma_interval_tree_verify From: Michel Lespinasse Content-Type: text/plain; charset=ISO-8859-1 Sender: owner-linux-mm@kvack.org List-ID: To: Bob Liu , Andrew Morton Cc: Sasha Levin , Sasha Levin , hughd@google.com, linux-mm , "linux-kernel@vger.kernel.org" , Dave Jones On Mon, Nov 5, 2012 at 5:41 AM, Michel Lespinasse wrote: > On Sun, Nov 4, 2012 at 8:44 PM, Michel Lespinasse wrote: >> On Sun, Nov 4, 2012 at 8:14 PM, Bob Liu wrote: >>> Hmm, I attached a simple fix patch. >> >> Reviewed-by: Michel Lespinasse >> (also ran some tests with it, but I could never reproduce the original >> issue anyway). > > Wait a minute, this is actually wrong. You need to call > vma_lock_anon_vma() / vma_unlock_anon_vma() to avoid the issue with > vma->anon_vma == NULL. > > I'll fix it and integrate it into my next patch series, which I intend > to send later today. (I am adding new code into validate_mm(), so that > it's easier to have it in the same patch series to avoid merge > conflicts) Hmmm, now I'm getting confused about anon_vma locking again :/ As Hugh privately remarked to me, the same_vma linked list is supposed to be protected by exclusive mmap_sem ownership, not by anon_vma lock. So now looking at it a bit more, I'm not sure what race we're preventing by taking the anon_vma lock in validate_mm() ??? -- Michel "Walken" Lespinasse A program is never fully debugged until the last user dies. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org