public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Rakib Mullick <rakib.mullick@gmail.com>
Cc: Fengguang Wu <fengguang.wu@intel.com>, linux-kernel@vger.kernel.org
Subject: Re: [nsproxy] BUG: unable to handle kernel NULL pointer dereference at 0000000000000024
Date: Sat, 09 Mar 2013 00:33:00 -0800	[thread overview]
Message-ID: <877glhkm6b.fsf@xmission.com> (raw)
In-Reply-To: <CADZ9YHhPq7aWwmyBoEt+CsGnKfKTeZN1bCT-LtwtJxUaHGwJ=g@mail.gmail.com> (Rakib Mullick's message of "Sat, 9 Mar 2013 09:54:45 +0600")

Rakib Mullick <rakib.mullick@gmail.com> writes:

> On Fri, Mar 8, 2013 at 10:01 PM, Eric W. Biederman
> <ebiederm@xmission.com> wrote:
>>
>> When a new task is created one of two things needs to happen.
>> A) A reference count needs to be added to the current nsproxy.
>> B) B a new nsproxy needs to be created.
>>
>> The way that code works today is far from a shiny example of totally
>> clear code but it is not incorrect.
>>
>> By moving get_nsproxy down below the first return 0, you removed taking
>> the reference count in the one case it is important.
>>
>> Arguably we should apply the patch below for clarity, and I just might
>> queue it up for 3.10.
>>
> This one is much more cleaner. One thing regarding this patch, can we
> check the namespace related flags at copy_namespace() call time at
> copy_process(), also get_nsproxy()? I think this will reduce some
> extra function call overhead and as you've mentioned get_nsproxy() is
> needed at every process creation.

If you can write a benchmark that can tell the difference, and the code
continues to be readable.  It would be worth making the change.

My gut says you are proposing an optimization that won't have
a measurable impact.

Eric

  reply	other threads:[~2013-03-09  8:33 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-07 13:28 [nsproxy] BUG: unable to handle kernel NULL pointer dereference at 0000000000000024 Fengguang Wu
2013-03-07 17:23 ` Eric W. Biederman
2013-03-08 11:38   ` Rakib Mullick
2013-03-08 16:01     ` Eric W. Biederman
2013-03-09  3:54       ` Rakib Mullick
2013-03-09  8:33         ` Eric W. Biederman [this message]
2013-03-09 16:48           ` Rakib Mullick
2013-03-11  8:12             ` Rakib Mullick

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877glhkm6b.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=fengguang.wu@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rakib.mullick@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox