Skip to contentSkip to conversation

pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()

PATCH Applied Patrick McHardy 2 participants 2 messages Nov 19, 2008 – Nov 20, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

commit c870f95c8c5c40d2c38970246ed737b8264f0b0e

Author: Patrick McHardy <[email protected]>
Date:   Wed Nov 19 14:19:11 2008 +0100

pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()

nla_nest_start() might return NULL, causing a NULL pointer dereference.

net/sched/sch_api.c +2 -0
index 5bcef13..1ef25e6 100644
@@ -422,6 +422,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);
 
maintainer Applied
#1 lore raw

From: Patrick McHardy <[email protected]>
Date: Wed, 19 Nov 2008 14:20:51 +0100

Quoted 9 lines

commit c870f95c8c5c40d2c38970246ed737b8264f0b0e

Author: Patrick McHardy <[email protected]>
Date:   Wed Nov 19 14:19:11 2008 +0100

pkt_sched: fix missing check for packet overrun in qdisc_dump_stab()

nla_nest_start() might return NULL, causing a NULL pointer dereference.

Applied.