From: Patrick McHardy Date: Thu, 20 Nov 2008 12:07:14 +0000 (-0800) Subject: pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() X-Git-Tag: upstream/snapshot3+hdmi~21422^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3aa4614da741f10b09559a5675c79e2eff5cccd8;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git pkt_sched: fix missing check for packet overrun in qdisc_dump_stab() nla_nest_start() might return NULL, causing a NULL pointer dereference. Signed-off-by: Patrick McHardy Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index b16ad29..6ab4a2f 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -417,6 +417,8 @@ static int qdisc_dump_stab(struct sk_buff *skb, struct qdisc_size_table *stab) struct nlattr *nest; nest = nla_nest_start(skb, TCA_STAB); + if (nest == NULL) + goto nla_put_failure; NLA_PUT(skb, TCA_STAB_BASE, sizeof(stab->szopts), &stab->szopts); nla_nest_end(skb, nest);