Thread (11 messages) 11 messages, 5 authors, 2013-07-30

Re: [patch] net_sched: stack info leak in cbq_dump_wrr()

From: Dan Carpenter <hidden>
Date: 2013-07-29 20:01:14
Also in: kernel-janitors

On Mon, Jul 29, 2013 at 12:44:32PM -0700, Joe Perches wrote:
On Mon, 2013-07-29 at 22:36 +0300, Dan Carpenter wrote:
quoted
opt.__reserved isn't cleared so we leak a byte of stack information.
[]
quoted
diff --git a/net/sched/sch_cbq.c b/net/sched/sch_cbq.c
[]
quoted
@@ -1469,6 +1469,7 @@ static int cbq_dump_wrr(struct sk_buff *skb, struct cbq_class *cl)
 	opt.allot = cl->allot;
 	opt.priority = cl->priority + 1;
 	opt.cpriority = cl->cpriority + 1;
+	opt.__reserved = 0;
 	opt.weight = cl->weight;
 	if (nla_put(skb, TCA_CBQ_WRROPT, sizeof(opt), &opt))
 		goto nla_put_failure;
Alignment isn't guaranteed here so it'd
probably be better with a memset.
Hm...  Which arches would align it differently?

regards,
dan carpenter
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help