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]
Date:   Sun, 29 Jan 2023 19:48:01 +0100
From:   Lorenzo Bianconi <lorenzo@...nel.org>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     bpf <bpf@...r.kernel.org>,
        Network Development <netdev@...r.kernel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andrii@...nel.org>,
        "David S. Miller" <davem@...emloft.net>,
        Jakub Kicinski <kuba@...nel.org>,
        Paolo Abeni <pabeni@...hat.com>,
        Eric Dumazet <edumazet@...gle.com>,
        Jesper Dangaard Brouer <hawk@...nel.org>,
        Toke Høiland-Jørgensen <toke@...hat.com>,
        Kumar Kartikeya Dwivedi <memxor@...il.com>,
        Marek Majtyka <alardam@...il.com>,
        Saeed Mahameed <saeedm@...dia.com>, anthony.l.nguyen@...el.com,
        Andy Gospodarek <gospo@...adcom.com>, vladimir.oltean@....com,
        Felix Fietkau <nbd@....name>, john@...ozen.org,
        Leon Romanovsky <leon@...nel.org>,
        Simon Horman <simon.horman@...igine.com>,
        Ariel Elior <aelior@...vell.com>,
        christophe.jaillet@...adoo.fr, ecree.xilinx@...il.com,
        "Michael S. Tsirkin" <mst@...hat.com>,
        Björn Töpel <bjorn@...nel.org>,
        "Karlsson, Magnus" <magnus.karlsson@...el.com>,
        "Fijalkowski, Maciej" <maciej.fijalkowski@...el.com>,
        intel-wired-lan <intel-wired-lan@...ts.osuosl.org>,
        Lorenzo Bianconi <lorenzo.bianconi@...hat.com>,
        Martin KaFai Lau <martin.lau@...ux.dev>,
        Stanislav Fomichev <sdf@...gle.com>
Subject: Re: [PATCH v4 bpf-next 8/8] selftests/bpf: introduce XDP compliance
 test tool

On Jan 28, Alexei Starovoitov wrote:
> On Sat, Jan 28, 2023 at 6:07 AM Lorenzo Bianconi <lorenzo@...nel.org> wrote:
> > diff --git a/tools/testing/selftests/bpf/xdp_features.h b/tools/testing/selftests/bpf/xdp_features.h
> > new file mode 100644
> > index 000000000000..28d7614c4f02
> > --- /dev/null
> > +++ b/tools/testing/selftests/bpf/xdp_features.h
> > @@ -0,0 +1,33 @@
> > +/* SPDX-License-Identifier: GPL-2.0 */
> > +
> > +/* test commands */
> > +enum test_commands {
> > +       CMD_STOP,               /* CMD */
> > +       CMD_START,              /* CMD + xdp feature */
> > +       CMD_ECHO,               /* CMD */
> > +       CMD_ACK,                /* CMD + data */
> > +       CMD_GET_XDP_CAP,        /* CMD */
> > +       CMD_GET_STATS,          /* CMD */
> > +};
> > +
> > +#define DUT_CTRL_PORT  12345
> > +#define DUT_ECHO_PORT  12346
> > +
> > +struct tlv_hdr {
> > +       __be16 type;
> > +       __be16 len;
> > +       __be32 data[];
> > +};
> > +
> > +enum {
> > +       XDP_FEATURE_ABORTED,
> > +       XDP_FEATURE_DROP,
> > +       XDP_FEATURE_PASS,
> > +       XDP_FEATURE_TX,
> > +       XDP_FEATURE_REDIRECT,
> > +       XDP_FEATURE_NDO_XMIT,
> > +       XDP_FEATURE_XSK_ZEROCOPY,
> > +       XDP_FEATURE_HW_OFFLOAD,
> > +       XDP_FEATURE_RX_SG,
> > +       XDP_FEATURE_NDO_XMIT_SG,
> > +};
> 
> This doesn't match the kernel.
> How did you test this?
> What should be the way to prevent such mistakes in the future?

Hi Alexei,

I added the XDP_FEATURE_* enum above since the XDP compliance test tool needs
to differentiate between actions in NETDEV_XDP_ACT_BASIC (e.g XDP_TX and
XDP_PASS or XDP_REDIRECT are handled differently in the ebpf programs installed
on the tester and DUT devices). However, combining netdev_xdp_act and xdp_action
enum definitions, I think we can keep this logic in xdp_feature userspace part
and we can get rid of the XDP_FEATURE_* enum above.
I will fix it in v5.

Regards,
Lorenzo

Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ