lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACT4Y+bHhqdsYdDrU+Wq4cA1iu6NbhAE2vjJKWAqfnH5EtQ3mA@mail.gmail.com>
Date:   Thu, 23 Jan 2020 07:19:19 +0100
From:   Dmitry Vyukov <dvyukov@...gle.com>
To:     Eric Dumazet <eric.dumazet@...il.com>
Cc:     syzbot <syzbot+8ce4113dadc4789fac74@...kaller.appspotmail.com>,
        Andrii Nakryiko <andriin@...com>,
        Alexei Starovoitov <ast@...nel.org>, bpf <bpf@...r.kernel.org>,
        Jonathan Corbet <corbet@....net>,
        Daniel Borkmann <daniel@...earbox.net>,
        David Miller <davem@...emloft.net>,
        David Ahern <dsahern@...il.com>, hawk@...nel.org,
        John Fastabend <john.fastabend@...il.com>,
        Martin KaFai Lau <kafai@...com>, kuba@...nel.org,
        "open list:DOCUMENTATION" <linux-doc@...r.kernel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        netdev <netdev@...r.kernel.org>,
        Song Liu <songliubraving@...com>,
        syzkaller-bugs <syzkaller-bugs@...glegroups.com>,
        Yonghong Song <yhs@...com>
Subject: Re: WARNING in bpf_warn_invalid_xdp_action

On Wed, Jan 22, 2020 at 10:38 PM Eric Dumazet <eric.dumazet@...il.com> wrote:
>
>
>
> On 1/22/20 1:01 PM, syzbot wrote:
> > syzbot has bisected this bug to:
> >
> > commit 58956317c8de52009d1a38a721474c24aef74fe7
> > Author: David Ahern <dsahern@...il.com>
> > Date:   Fri Dec 7 20:24:57 2018 +0000
> >
> >     neighbor: Improve garbage collection
> >
> > bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=124a5985e00000
> > start commit:   d0f41851 net, ip_tunnel: fix namespaces move
> > git tree:       net
> > final crash:    https://syzkaller.appspot.com/x/report.txt?x=114a5985e00000
> > console output: https://syzkaller.appspot.com/x/log.txt?x=164a5985e00000
> > kernel config:  https://syzkaller.appspot.com/x/.config?x=d9290aeb7e6cf1c4
> > dashboard link: https://syzkaller.appspot.com/bug?extid=8ce4113dadc4789fac74
> > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=11f99369e00000
> > C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=13d85601e00000
> >
> > Reported-by: syzbot+8ce4113dadc4789fac74@...kaller.appspotmail.com
> > Fixes: 58956317c8de ("neighbor: Improve garbage collection")
> >
> > For information about bisection process see: https://goo.gl/tpsmEJ#bisection
> >
>
> bisection looks bogus...
>
> It would be nice to have alternative helpers to conveniently replace some WARN_ON/WARN_ONCE/...
> and not having to hand-code stuff like :
>
> diff --git a/net/core/filter.c b/net/core/filter.c
> index 538f6a735a19f017df8e10149cb578107ddc8cbb..633988f7c81b3b4f015d827ccb485e8b227ad20b 100644
> --- a/net/core/filter.c
> +++ b/net/core/filter.c
> @@ -6913,11 +6913,15 @@ static bool xdp_is_valid_access(int off, int size,
>
>  void bpf_warn_invalid_xdp_action(u32 act)
>  {
> +       static bool __section(.data.once) warned;
>         const u32 act_max = XDP_REDIRECT;
>
> -       WARN_ONCE(1, "%s XDP return value %u, expect packet loss!\n",
> -                 act > act_max ? "Illegal" : "Driver unsupported",
> -                 act);
> +       if (!warned) {
> +               warned = true;
> +               pr_err("%s XDP return value %u, expect packet loss!\n",
> +                      act > act_max ? "Illegal" : "Driver unsupported", act);
> +               dump_stack();
> +       }
>  }
>  EXPORT_SYMBOL_GPL(bpf_warn_invalid_xdp_action);

If a single caller of this function would be enough (or maybe grand
caller with a macro), then we could use pr_err_once/ratelimited and
print 1 line with error and caller function.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ