net sched: fix some kernel memory leaks
We leak at least 32bits of kernel memory to user land in tc dump, because we dont init all fields (capab ?) of the dumped structure. Use C99 initializers so that holes and non explicit fields are zeroed. Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
001389b958
commit
1c40be12f7
@ -164,13 +164,14 @@ static inline int tcf_simp_dump(struct sk_buff *skb, struct tc_action *a,
|
||||
{
|
||||
unsigned char *b = skb_tail_pointer(skb);
|
||||
struct tcf_defact *d = a->priv;
|
||||
struct tc_defact opt;
|
||||
struct tc_defact opt = {
|
||||
.index = d->tcf_index,
|
||||
.refcnt = d->tcf_refcnt - ref,
|
||||
.bindcnt = d->tcf_bindcnt - bind,
|
||||
.action = d->tcf_action,
|
||||
};
|
||||
struct tcf_t t;
|
||||
|
||||
opt.index = d->tcf_index;
|
||||
opt.refcnt = d->tcf_refcnt - ref;
|
||||
opt.bindcnt = d->tcf_bindcnt - bind;
|
||||
opt.action = d->tcf_action;
|
||||
NLA_PUT(skb, TCA_DEF_PARMS, sizeof(opt), &opt);
|
||||
NLA_PUT_STRING(skb, TCA_DEF_DATA, d->tcfd_defdata);
|
||||
t.install = jiffies_to_clock_t(jiffies - d->tcf_tm.install);
|
||||
|
Reference in New Issue
Block a user