Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754796Ab2JHUqo (ORCPT ); Mon, 8 Oct 2012 16:46:44 -0400 Received: from mail-pa0-f46.google.com ([209.85.220.46]:43750 "EHLO mail-pa0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753163Ab2JHUqk (ORCPT ); Mon, 8 Oct 2012 16:46:40 -0400 Date: Mon, 8 Oct 2012 13:46:38 -0700 (PDT) From: David Rientjes X-X-Sender: rientjes@chino.kir.corp.google.com To: Dave Jones , Linux Kernel , bhutchings@solarflare.com, linux-mm@kvack.org, Linus Torvalds , Andrew Morton Subject: Re: mpol_to_str revisited. In-Reply-To: <20121008151552.GA10881@redhat.com> Message-ID: References: <20121008150949.GA15130@redhat.com> <20121008151552.GA10881@redhat.com> User-Agent: Alpine 2.00 (DEB 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: 705 Lines: 16 On Mon, 8 Oct 2012, Dave Jones wrote: > If pol->mode was poisoned, that smells like we have a race where policy is getting freed > while another process is reading it. > > Am I missing something, or is there no locking around that at all ? > The only thing that is held during the read() is a reference to the task_struct so it doesn't disappear from under us. The protection needed for a task's mempolicy, however, is task_lock() and that is not held. -- 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/