lkml.org 
[lkml]   [2022]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [syzbot] WARNING in u32_change
On Sun, Sep 25, 2022 at 10:13 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
>
> To be clear, that splat didnt happen for me.
> Is there something else syzbot does to activate it?

Sure, please look at:

commit 54d9469bc515dc5fcbc20eecbe19cea868b70d68
Author: Kees Cook <keescook@chromium.org>
Date: Thu Jun 24 15:39:26 2021 -0700

fortify: Add run-time WARN for cross-field memcpy()


>
> cheers,
> jamal
>
> On Sun, Sep 25, 2022 at 1:08 PM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> >
> > Yes, after testing i realize there is nothing wrong here.
> > What warning was i supposed to see from running the reproducer?
> >
> > We will still add the test will multiple keys later
> >
> > cheers,
> > jamal
> >
> > On Sun, Sep 25, 2022 at 12:29 PM Eric Dumazet <edumazet@google.com> wrote:
> > >
> > > On Sun, Sep 25, 2022 at 9:14 AM Jamal Hadi Salim <jhs@mojatatu.com> wrote:
> > > >
> > > > On Sun, Sep 25, 2022 at 11:38 AM Jamal Hadi Salim <jhs@mojatatu.com> 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;
> > >
> > > This patch is not needed, please look at struct_size() definition.
> > >
> > > Here, we might switch to unsafe_memcpy() instead of memcpy()

\
 
 \ /
  Last update: 2022-09-25 19:35    [W:0.050 / U:2.340 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site