Re: [PATCH bpf-next v2 2/2] selftests/bpf: Make sure zero-len skbs aren't redirectable

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux