lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CA+1xoqe_VGuUaMCpWWz=gSBBmGu8cUha9qznzhy_jNCRknudBA@mail.gmail.com>
Date:	Fri, 6 Apr 2012 11:22:13 +0200
From:	Sasha Levin <levinsasha928@...il.com>
To:	Hans Schillstrom <hans@...illstrom.com>
Cc:	Simon Horman <horms@...ge.net.au>, wensong@...ux-vs.org, ja@....bg,
	kaber@...sh.net, davem@...emloft.net, davej@...hat.com,
	netdev@...r.kernel.org, lvs-devel@...r.kernel.org,
	netfilter-devel@...r.kernel.org, linux-kernel@...r.kernel.org
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@...illstrom.com> wrote:
> Hello Simon
>
>>---- Original Message ----
>>From: Simon Horman <horms@...ge.net.au>
>>To: "Sasha Levin" <levinsasha928@...il.com>
>>Cc: wensong@...ux-vs.org, ja@....bg, kaber@...sh.net, davem@...emloft.net, davej@...hat.com, netdev@...r.kernel.org, lvs-devel@...r.kernel.org, netfilter-devel@...r.kernel.org, linux-kernel@...r.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.

Either way, you shouldn't be dereferencing NULL ptrs even when the
system is really low on memory.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ