All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Olsa <olsajiri@gmail.com>
To: Yonghong Song <yhs@meta.com>
Cc: sdf@google.com, Jiri Olsa <olsajiri@gmail.com>,
	bpf@vger.kernel.org, ast@kernel.org, daniel@iogearbox.net,
	andrii@kernel.org, martin.lau@linux.dev, song@kernel.org,
	yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org,
	haoluo@google.com
Subject: Re: [PATCH bpf-next v2 2/2] selftests/bpf: Make sure zero-len skbs aren't redirectable
Date: Wed, 23 Nov 2022 22:20:41 +0100	[thread overview]
Message-ID: <Y36OqcjByl8ruOpS@krava> (raw)
In-Reply-To: <63b85917-a2ea-8e35-620c-808560910819@meta.com>

On Wed, Nov 23, 2022 at 11:07:18AM -0800, Yonghong Song wrote:

SNIP

> > > > if I comment out all the umounts in setns_by_fd, it does not fail
> > 
> > > Agreed with the above observations.
> > > With the current bpf-next, I can easily hit the above perf event ID
> > > issue.
> > 
> > > But if I backout the following two patches:
> > > 68f8e3d4b916531ea3bb8b83e35138cf78f2fce5 selftests/bpf: Make sure
> > > zero-len
> > > skbs aren't redirectable
> > > 114039b342014680911c35bd6b72624180fd669a bpf: Move skb->len == 0
> > > checks into
> > > __bpf_redirect
> > 
> > 
> > > and run a few times with './test_progs -j' and I didn't hit any issues.
> > 
> > My guess would be that we need to remount debugfs in setns_by_fd?
> > 
> > diff --git a/tools/testing/selftests/bpf/network_helpers.c
> > b/tools/testing/selftests/bpf/network_helpers.c
> > index bec15558fd93..1f37adff7632 100644
> > --- a/tools/testing/selftests/bpf/network_helpers.c
> > +++ b/tools/testing/selftests/bpf/network_helpers.c
> > @@ -426,6 +426,10 @@ static int setns_by_fd(int nsfd)
> >       if (!ASSERT_OK(err, "mount /sys/fs/bpf"))
> >           return err;
> > 
> > +    err = mount("debugfs", "/sys/kernel/debug", "debugfs", 0, NULL);
> > +    if (!ASSERT_OK(err, "mount /sys/kernel/debug"))
> > +        return err;
> > +
> >       return 0;
> >   }
> 
> Ya, this does fix the problem. Could you craft a patch for this?

same here ;-) thanks

jirka

  parent reply	other threads:[~2022-11-23 21:20 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-21 18:03 [PATCH bpf-next v2 1/2] bpf: Move skb->len == 0 checks into __bpf_redirect Stanislav Fomichev
2022-11-21 18:03 ` [PATCH bpf-next v2 2/2] selftests/bpf: Make sure zero-len skbs aren't redirectable Stanislav Fomichev
2022-11-23 12:23   ` Jiri Olsa
2022-11-23 16:18     ` Yonghong Song
2022-11-23 17:17       ` sdf
2022-11-23 19:07         ` Yonghong Song
2022-11-23 19:54           ` Stanislav Fomichev
2022-11-23 21:20           ` Jiri Olsa [this message]
2023-09-08 16:54   ` Daniel Borkmann
2023-09-08 17:17     ` Stanislav Fomichev
2022-11-21 21:00 ` [PATCH bpf-next v2 1/2] bpf: Move skb->len == 0 checks into __bpf_redirect patchwork-bot+netdevbpf

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=Y36OqcjByl8ruOpS@krava \
    --to=olsajiri@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=daniel@iogearbox.net \
    --cc=haoluo@google.com \
    --cc=john.fastabend@gmail.com \
    --cc=kpsingh@kernel.org \
    --cc=martin.lau@linux.dev \
    --cc=sdf@google.com \
    --cc=song@kernel.org \
    --cc=yhs@fb.com \
    --cc=yhs@meta.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.