aboutsummaryrefslogtreecommitdiff
path: root/net/ipv4
diff options
context:
space:
mode:
authorAlexey Dobriyan <adobriyan@openvz.org>2007-02-26 01:31:58 +0100
committerAdrian Bunk <bunk@stusta.de>2007-02-26 01:31:58 +0100
commit666ebed8390d4cf3d0411163c6c2e0098e6a148e (patch)
tree6d72c2b8f2414cadc21dda5d3625f95c52ab6772 /net/ipv4
parent56f2853fef447fd3e0b4df202294fca58ecdfdc1 (diff)
[IPV4/IPV6] multicast: Check add_grhead() return value
add_grhead() allocates memory with GFP_ATOMIC and in at least two places skb from it passed to skb_put() without checking. Adrian Bunk: backported to 2.6.16 Signed-off-by: Alexey Dobriyan <adobriyan@openvz.org> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Adrian Bunk <bunk@stusta.de>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/igmp.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/net/ipv4/igmp.c b/net/ipv4/igmp.c
index 64ce52bf048..39e30c79f25 100644
--- a/net/ipv4/igmp.c
+++ b/net/ipv4/igmp.c
@@ -456,6 +456,8 @@ static struct sk_buff *add_grec(struct sk_buff *skb, struct ip_mc_list *pmc,
skb = add_grhead(skb, pmc, type, &pgr);
first = 0;
}
+ if (!skb)
+ return NULL;
psrc = (u32 *)skb_put(skb, sizeof(u32));
*psrc = psf->sf_inaddr;
scount++; stotal++;