Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764780AbYA2QHw (ORCPT ); Tue, 29 Jan 2008 11:07:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757076AbYA2QHm (ORCPT ); Tue, 29 Jan 2008 11:07:42 -0500 Received: from relay1.sgi.com ([192.48.171.29]:51045 "EHLO relay.sgi.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756617AbYA2QHl (ORCPT ); Tue, 29 Jan 2008 11:07:41 -0500 Date: Tue, 29 Jan 2008 10:07:37 -0600 From: Robin Holt To: Christoph Lameter Cc: Andrea Arcangeli , Robin Holt , Avi Kivity , Izik Eidus , Nick Piggin , kvm-devel@lists.sourceforge.net, Benjamin Herrenschmidt , Peter Zijlstra , steiner@sgi.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, daniel.blueman@quadrics.com, Hugh Dickins Subject: Re: [patch 1/6] mmu_notifier: Core code Message-ID: <20080129160737.GV3058@sgi.com> References: <20080128202840.974253868@sgi.com> <20080128202923.609249585@sgi.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20080128202923.609249585@sgi.com> User-Agent: Mutt/1.5.15+20070412 (2007-04-11) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 794 Lines: 22 I am going to seperate my comments into individual replies to help reduce the chance they are lost. > +void mmu_notifier_release(struct mm_struct *mm) ... > + hlist_for_each_entry_safe_rcu(mn, n, t, > + &mm->mmu_notifier.head, hlist) { > + if (mn->ops->release) > + mn->ops->release(mn, mm); > + hlist_del(&mn->hlist); This is a use-after-free issue. The hlist_del_rcu needs to be done before the callout as the structure containing the mmu_notifier structure will need to be freed from within the ->release callout. Thanks, Robin -- 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/