linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Hans Schillstrom" <hans@schillstrom.com>
To: "Sasha Levin" <levinsasha928@gmail.com>
Cc: "Simon Horman" <horms@verge.net.au>,
	wensong@linux-vs.org, ja@ssi.bg, kaber@trash.net,
	davem@davemloft.net, davej@redhat.com, netdev@vger.kernel.org,
	lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re[2]:  Re[2]: [PATCH] netfilter: ipvs: Verify that IP_VS  protocol has been registered
Date: Fri, 6 Apr 2012 11:39:50 +0200 (CEST)	[thread overview]
Message-ID: <6dfqp4f.4ae84ae68d6556b1585957b381280d94@obelix.schillstrom.com> (raw)

Hello Sasha

>---- Original Message ----
>From: Sasha Levin <levinsasha928@gmail.com>
>To: "Hans Schillstrom" <hans@schillstrom.com>
>Cc: "Simon Horman" <horms@verge.net.au>, wensong@linux-vs.org, ja@ssi.bg, kaber@trash.net, davem@davemloft.net, davej@redhat.com, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org
>Sent: Fri, Apr 6, 2012, 11:22 AM
>Subject: Re: Re[2]: [PATCH] netfilter: ipvs: Verify that IP_VS protocol has been registered
>
>On Fri, Apr 6, 2012 at 10:59 AM, Hans Schillstrom <hans@schillstrom.com> wrote:
>> Hello Simon
>>
>>>---- Original Message ----
>>>From: Simon Horman <horms@verge.net.au>
>>>To: "Sasha Levin" <levinsasha928@gmail.com>
>>>Cc: wensong@linux-vs.org, ja@ssi.bg, kaber@trash.net, davem@davemloft.net, davej@redhat.com, netdev@vger.kernel.org, lvs-devel@vger.kernel.org, netfilter-devel@vger.kernel.org, linux-kernel@vger.kernel.org
>>>Sent: Fri, Apr 6, 2012, 1:19 AM
>>>Subject: Re: [PATCH] netfilter: ipvs: Verify that IP_VS protocol has been registered
>>>
>>>On Thu, Apr 05, 2012 at 07:24:33PM -0400, Sasha Levin wrote:
>>>> The registration of a protocol might fail, there were no checks
>>>> and all registrations were assumed to be correct. This lead to
>>>> NULL ptr dereferences when apps tried registering.
>>>
>>>Thanks, I will queue up this fix.
>>>
>>>Do you have a real-world example of this failing, if so it
>>>might be worth pushing your change into stable.
>>
>> I don't think this is a big thing, the only thing that can cause it is out of memory,
>> and that will cause a "kernel death" anyway :-(
>>
>> here is the code :
>>
>> register_ip_vs_proto_netns(struct net *net, struct ip_vs_protocol *pp)
>> {
>> ...
>>        struct ip_vs_proto_data *pd =
>>                        kzalloc(sizeof(struct ip_vs_proto_data), GFP_ATOMIC);
>>
>>        if (!pd)
>>                return -ENOMEM;
>>
>>
>
>Considering that the allocation gfp flag here is GFP_ATOMIC (why is it
>GFP_ATOMIC btw?), it might fail for a variety of reasons which may
>occur when the system is "healthy", for example - if it needs disk I/O
>to allocate.

Hmm, I think it should be GFP_KERNEL
I will have a look at this, and make it consistent with the rest of the netns allocations,

>
>Either way, you shouldn't be dereferencing NULL ptrs even when the
>system is really low on memory.

Of course not, it's a bug  

Simon:
I think you should push this one into stable 


Thanks Sasha


Regards
Hans 



                 reply	other threads:[~2012-04-06  9:39 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=6dfqp4f.4ae84ae68d6556b1585957b381280d94@obelix.schillstrom.com \
    --to=hans@schillstrom.com \
    --cc=davej@redhat.com \
    --cc=davem@davemloft.net \
    --cc=horms@verge.net.au \
    --cc=ja@ssi.bg \
    --cc=kaber@trash.net \
    --cc=levinsasha928@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lvs-devel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=netfilter-devel@vger.kernel.org \
    --cc=wensong@linux-vs.org \
    /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;
as well as URLs for NNTP newsgroup(s).