From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brian Haley Subject: Re: [PATCH 1/2] netns: fix NULL-dereference in dev_net() Date: Thu, 14 Aug 2008 16:29:13 -0400 Message-ID: <48A49599.40307@hp.com> References: <48A4871D.1030708@hp.com> <1218745207.16589.77.camel@iris.sw.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: David Miller , netdev@vger.kernel.org, containers To: "Denis V. Lunev" Return-path: Received: from g5t0007.atlanta.hp.com ([15.192.0.44]:21177 "EHLO g5t0007.atlanta.hp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752730AbYHNU3R (ORCPT ); Thu, 14 Aug 2008 16:29:17 -0400 In-Reply-To: <1218745207.16589.77.camel@iris.sw.ru> Sender: netdev-owner@vger.kernel.org List-ID: Denis V. Lunev wrote: > On Thu, 2008-08-14 at 15:27 -0400, Brian Haley wrote: >> Change dev_net() to handle a NULL argument - return &init_net instead. >> >> -Brian >> >> Signed-off-by: Brian Haley >> --- >> > the code is designed keeping in mind that there are no checks for > net != NULL > in any place. They are too expensive. We need to invent other way :( Ok, I'll fix the other callers to pass *net, I was just trying to be overly safe in dev_net() to avoid a crash. -Brian