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:   Thu, 21 May 2020 12:09:01 -0700
From:   John Fastabend <john.fastabend@...il.com>
To:     John Fastabend <john.fastabend@...il.com>,
        Andrii Nakryiko <andrii.nakryiko@...il.com>,
        John Fastabend <john.fastabend@...il.com>
Cc:     Yonghong Song <yhs@...com>, Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Lorenz Bauer <lmb@...udflare.com>, bpf <bpf@...r.kernel.org>,
        Jakub Sitnicki <jakub@...udflare.com>,
        Networking <netdev@...r.kernel.org>
Subject: Re: [bpf-next PATCH v3 4/5] bpf: selftests, add sk_msg helpers load
 and attach test

John Fastabend wrote:
> Andrii Nakryiko wrote:
> > On Thu, May 21, 2020 at 7:36 AM John Fastabend <john.fastabend@...il.com> wrote:
> > >
> > > The test itself is not particularly useful but it encodes a common
> > > pattern we have.
> > >
> > > Namely do a sk storage lookup then depending on data here decide if
> > > we need to do more work or alternatively allow packet to PASS. Then
> > > if we need to do more work consult task_struct for more information
> > > about the running task. Finally based on this additional information
> > > drop or pass the data. In this case the suspicious check is not so
> > > realisitic but it encodes the general pattern and uses the helpers
> > > so we test the workflow.
> > >
> > > This is a load test to ensure verifier correctly handles this case.
> > >
> > > Signed-off-by: John Fastabend <john.fastabend@...il.com>
> > > ---

[...]

> > > +static void test_skmsg_helpers(enum bpf_map_type map_type)
> > > +{
> > > +       struct test_skmsg_load_helpers *skel;
> > > +       int err, map, verdict;
> > > +
> > > +       skel = test_skmsg_load_helpers__open_and_load();
> > > +       if (!skel) {
> > > +               FAIL("skeleton open/load failed");
> > > +               return;
> > > +       }
> > > +
> > > +       verdict = bpf_program__fd(skel->progs.prog_msg_verdict);
> > > +       map = bpf_map__fd(skel->maps.sock_map);
> > > +
> > > +       err = xbpf_prog_attach(verdict, map, BPF_SK_MSG_VERDICT, 0);
> > > +       if (err)
> > > +               return;
> > > +       xbpf_prog_detach2(verdict, map, BPF_SK_MSG_VERDICT);
> > 
> > no cleanup in this test, at all
> 
> Guess we need __destroy(skel) here.
> 
> As an aside how come if the program closes and refcnt drops the entire
> thing isn't destroyed. I didn't think there was any pinning happening
> in the __open_and_load piece.

I guess these are in progs_test so we can't leave these around for
any following tests to trip over. OK. Same thing for patch 3 fwiw.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ