bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Olsa <jolsa@redhat.com>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>, Alexei Starovoitov <ast@kernel.org>,
	Daniel Borkmann <daniel@iogearbox.net>,
	Wenbo Zhang <ethercflow@gmail.com>,
	Andrii Nakryiko <andriin@fb.com>,
	Network Development <netdev@vger.kernel.org>,
	bpf <bpf@vger.kernel.org>, Martin KaFai Lau <kafai@fb.com>,
	Song Liu <songliubraving@fb.com>, Yonghong Song <yhs@fb.com>,
	John Fastabend <john.fastabend@gmail.com>,
	KP Singh <kpsingh@chromium.org>,
	Jesper Dangaard Brouer <brouer@redhat.com>
Subject: Re: [PATCH v12 bpf-next 13/14] selftests/bpf: Add test for d_path helper
Date: Wed, 26 Aug 2020 11:30:30 +0200	[thread overview]
Message-ID: <20200826093030.GB703542@krava> (raw)
In-Reply-To: <CAADnVQ+_X4-eWW_wNDr9G+Ac6LObQeJ5uCxgetGpR2F33BFk5A@mail.gmail.com>

On Tue, Aug 25, 2020 at 04:06:14PM -0700, Alexei Starovoitov wrote:
> On Tue, Aug 25, 2020 at 12:22 PM Jiri Olsa <jolsa@kernel.org> wrote:
> > +
> > +static int trigger_fstat_events(pid_t pid)
> > +{
> > +       int sockfd = -1, procfd = -1, devfd = -1;
> > +       int localfd = -1, indicatorfd = -1;
> > +       int pipefd[2] = { -1, -1 };
> > +       struct stat fileStat;
> > +       int ret = -1;
> > +
> > +       /* unmountable pseudo-filesystems */
> > +       if (CHECK(pipe(pipefd) < 0, "trigger", "pipe failed\n"))
> > +               return ret;
> > +       /* unmountable pseudo-filesystems */
> > +       sockfd = socket(AF_INET, SOCK_STREAM, 0);
> > +       if (CHECK(sockfd < 0, "trigger", "scoket failed\n"))
> > +               goto out_close;
> > +       /* mountable pseudo-filesystems */
> > +       procfd = open("/proc/self/comm", O_RDONLY);
> > +       if (CHECK(procfd < 0, "trigger", "open /proc/self/comm failed\n"))
> > +               goto out_close;
> > +       devfd = open("/dev/urandom", O_RDONLY);
> > +       if (CHECK(devfd < 0, "trigger", "open /dev/urandom failed\n"))
> > +               goto out_close;
> > +       localfd = open("/tmp/d_path_loadgen.txt", O_CREAT | O_RDONLY);
> 
> The work-in-progress CI caught a problem here:
> 
> In file included from /usr/include/fcntl.h:290:0,
> 4814                 from ./test_progs.h:29,
> 4815                 from
> /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:3:
> 4816In function ‘open’,
> 4817    inlined from ‘trigger_fstat_events’ at
> /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:50:10,
> 4818    inlined from ‘test_d_path’ at
> /home/travis/build/tsipa/bpf-next/tools/testing/selftests/bpf/prog_tests/d_path.c:119:6:
> 4819/usr/include/x86_64-linux-gnu/bits/fcntl2.h:50:4: error: call to
> ‘__open_missing_mode’ declared with attribute error: open with O_CREAT
> or O_TMPFILE in second argument needs 3 arguments
> 4820    __open_missing_mode ();
> 4821    ^~~~~~~~~~~~~~~~~~~~~~

ok, looks like it's missing the permission bits

> 
> I don't see this bug in my setup, since I'm using an older glibc that
> doesn't have this check,
> so I've pushed it anyway since it was taking a bit long to land and folks were
> eagerly waiting for the allowlist and d_path features.
> But some other folks may complain about build breakage really soon.
> So please follow up asap.

time to upadte my systems, I'm missing new warnings ;-)

I'll send the fix

thanks,
jirka


  reply	other threads:[~2020-08-26  9:30 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-25 19:21 [PATCH v12 bpf-next 00/14] bpf: Add d_path helper Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 01/14] tools resolve_btfids: Add size check to get_id function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 02/14] tools resolve_btfids: Add support for set symbols Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 03/14] bpf: Move btf_resolve_size into __btf_resolve_size Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 04/14] bpf: Add elem_id pointer as argument to __btf_resolve_size Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 05/14] bpf: Add type_id " Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 06/14] bpf: Remove recursion call in btf_struct_access Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 07/14] bpf: Factor btf_struct_access function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 08/14] bpf: Add btf_struct_ids_match function Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 09/14] bpf: Add BTF_SET_START/END macros Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 10/14] bpf: Add d_path helper Jiri Olsa
2020-08-25 22:58   ` Alexei Starovoitov
2020-08-26  9:25     ` Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 11/14] bpf: Update .BTF_ids section in btf.rst with sets info Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 12/14] selftests/bpf: Add verifier test for d_path helper Jiri Olsa
2020-08-25 19:21 ` [PATCH v12 bpf-next 13/14] selftests/bpf: Add " Jiri Olsa
2020-08-25 23:06   ` Alexei Starovoitov
2020-08-26  9:30     ` Jiri Olsa [this message]
2020-08-25 19:21 ` [PATCH v12 bpf-next 14/14] selftests/bpf: Add set test to resolve_btfids Jiri Olsa

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200826093030.GB703542@krava \
    --to=jolsa@redhat.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andriin@fb.com \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=ethercflow@gmail.com \
    --cc=john.fastabend@gmail.com \
    --cc=jolsa@kernel.org \
    --cc=kafai@fb.com \
    --cc=kpsingh@chromium.org \
    --cc=netdev@vger.kernel.org \
    --cc=songliubraving@fb.com \
    --cc=yhs@fb.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).