Thread (12 messages) flat view 12 messages, 6 authors, 2022-10-06

Re: [syzbot] WARNING in u32_change

From: Jamal Hadi Salim <jhs@mojatatu.com>
Date: 2022-09-25 16:15:06
Also in: lkml
Subsystem: networking [general], tc subsystem, the rest · Maintainers: "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Jamal Hadi Salim, Jiri Pirko, Linus Torvalds

On Sun, Sep 25, 2022 at 11:38 AM Jamal Hadi Salim [off-list ref] wrote:
Is there a way to tell the boat "looking into it?"

I guess I have to swim across to it to get the message;->

I couldnt see the warning message  but it is obvious by inspection that
the memcpy is broken. We should add more test coverage.
This should fix it. Will send a formal patch later:
diff --git a/net/sched/cls_u32.c b/net/sched/cls_u32.c
index 4d27300c2..591cbbf27 100644
--- a/net/sched/cls_u32.c
+++ b/net/sched/cls_u32.c
@@ -1019,7 +1019,7 @@ static int u32_change(struct net *net, struct
sk_buff *in_skb,
        }

        s = nla_data(tb[TCA_U32_SEL]);
-       sel_size = struct_size(s, keys, s->nkeys);
+       sel_size = struct_size(s, keys, s->nkeys) + sizeof(n->sel);
        if (nla_len(tb[TCA_U32_SEL]) < sel_size) {
                err = -EINVAL;
                goto erridr;
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help