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] [day] [month] [year] [list]
Message-ID: <CAJ8uoz2Pj+m5n6vNavY1JCVTY+dTTCuuQ7NurgxvAfHdmoH4KQ@mail.gmail.com>
Date:   Thu, 10 Dec 2020 17:25:59 +0100
From:   Magnus Karlsson <magnus.karlsson@...il.com>
To:     Daniel Borkmann <daniel@...earbox.net>
Cc:     "Karlsson, Magnus" <magnus.karlsson@...el.com>,
        Björn Töpel <bjorn.topel@...el.com>,
        Alexei Starovoitov <ast@...nel.org>,
        Network Development <netdev@...r.kernel.org>,
        bpf <bpf@...r.kernel.org>,
        Jonathan Lemon <jonathan.lemon@...il.com>,
        "Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>,
        Maciej Fijalkowski <maciejromanfijalkowski@...il.com>
Subject: Re: [PATCH bpf-next] samples/bpf: fix possible hang in xdpsock with
 multiple threads

On Thu, Dec 10, 2020 at 5:03 PM Daniel Borkmann <daniel@...earbox.net> wrote:
>
> On 12/10/20 4:36 PM, Magnus Karlsson wrote:
> > From: Magnus Karlsson <magnus.karlsson@...el.com>
> >
> > Fix a possible hang in xdpsock that can occur when using multiple
> > threads. In this case, one or more of the threads might get stuck in
> > the while-loop in tx_only after the user has signaled the main thread
> > to stop execution. In this case, no more Tx packets will be sent, so a
> > thread might get stuck in the aforementioned while-loop. Fix this by
> > introducing a test inside the while-loop to check if the benchmark has
> > been terminated. If so, exit the loop.
> >
> > Fixes: cd9e72b6f210 ("samples/bpf: xdpsock: Add option to specify batch size")
> > Signed-off-by: Magnus Karlsson <magnus.karlsson@...el.com>
>
> With the patch applied, I'm getting a new warning:
>
>    CC  /home/darkstar/trees/bpf-next/samples/bpf/xdpsock_user.o
> /home/darkstar/trees/bpf-next/samples/bpf/xdpsock_user.c: In function ‘main’:
> /home/darkstar/trees/bpf-next/samples/bpf/xdpsock_user.c:1272:6: warning: ‘idx’ may be used uninitialized in this function [-Wmaybe-uninitialized]
>   1272 |  u32 idx;
>        |      ^~~

Sorry, I get it too. It was just masked with the other warnings I get
these days when compiling the bpf samples. Regardless, it is the
compiler trying to tell me I have done something stupid :-(. It should
really be a return instead of a break, sigh. Will send a v2.

> Previously compiling w/o issues:
>
>   [...]
>    CC  /home/darkstar/trees/bpf-next/samples/bpf/xdpsock_ctrl_proc.o
>    CC  /home/darkstar/trees/bpf-next/samples/bpf/xdpsock_user.o
>    CC  /home/darkstar/trees/bpf-next/samples/bpf/xsk_fwd.o
>    LD  /home/darkstar/trees/bpf-next/samples/bpf/fds_example
>   [...]
>
> For testing, I used:
>
>    gcc --version
>    gcc (GCC) 9.0.1 20190312 (Red Hat 9.0.1-0.10)
>
> Ptal, thx!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ