Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759544Ab0LNQbL (ORCPT ); Tue, 14 Dec 2010 11:31:11 -0500 Received: from mx1.redhat.com ([209.132.183.28]:4910 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757308Ab0LNQbJ (ORCPT ); Tue, 14 Dec 2010 11:31:09 -0500 Date: Tue, 14 Dec 2010 17:24:06 +0100 From: Oleg Nesterov To: "Suzuki K. Poulose" Cc: linux-kernel@vger.kernel.org, Jeremy Fitzhardinge , Christoph Hellwig , Masami Hiramatsu , Ananth N Mavinakayanahalli , Daisuke HATAYAMA , Andi Kleen , Roland McGrath , Amerigo Wang , Linus Torvalds , KAMEZAWA Hiroyuki , KOSAKI Motohiro , Andrew Morton Subject: Re: [Patch 14/21] Create ELF header Message-ID: <20101214162406.GG11400@redhat.com> References: <20101214152259.67896960@suzukikp> <20101214154607.3ace278c@suzukikp> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20101214154607.3ace278c@suzukikp> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 668 Lines: 23 On 12/14, Suzuki K. Poulose wrote: > > +static void get_elfhdr_size(struct core_proc *cp) > +{ > + struct vm_area_struct *gate_vma; > + int segs; > + > + segs = cp->task->mm->map_count; But this is unsafe. What if cp->task was stopped when open_gencore() was called? In this case it can be killed/dead. cp->task->mm can be NULL. In fact, cp->task can point to nothing. Any usage of cp->task is not safe, afaics. Oleg. -- 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/