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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YGsZ0VGMk/hBfr2y@krava>
Date:   Mon, 5 Apr 2021 16:08:17 +0200
From:   Jiri Olsa <jolsa@...hat.com>
To:     Alexei Starovoitov <alexei.starovoitov@...il.com>
Cc:     Toke Høiland-Jørgensen <toke@...hat.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Alexei Starovoitov <ast@...nel.org>,
        Daniel Borkmann <daniel@...earbox.net>,
        Andrii Nakryiko <andriin@...com>, netdev@...r.kernel.org,
        bpf@...r.kernel.org, Martin KaFai Lau <kafai@...com>,
        Song Liu <songliubraving@...com>, Yonghong Song <yhs@...com>,
        John Fastabend <john.fastabend@...il.com>,
        KP Singh <kpsingh@...omium.org>
Subject: Re: [RFC PATCH bpf-next 1/4] bpf: Allow trampoline re-attach

On Sat, Apr 03, 2021 at 11:21:55AM -0700, Alexei Starovoitov wrote:
> On Sat, Apr 03, 2021 at 01:24:12PM +0200, Toke Høiland-Jørgensen wrote:
> > >  	if (!prog->aux->dst_trampoline && !tgt_prog) {
> > > -		err = -ENOENT;
> > > -		goto out_unlock;
> > > +		/*
> > > +		 * Allow re-attach for tracing programs, if it's currently
> > > +		 * linked, bpf_trampoline_link_prog will fail.
> > > +		 */
> > > +		if (prog->type != BPF_PROG_TYPE_TRACING) {
> > > +			err = -ENOENT;
> > > +			goto out_unlock;
> > > +		}
> > > +		if (!prog->aux->attach_btf) {
> > > +			err = -EINVAL;
> > > +			goto out_unlock;
> > > +		}
> > 
> > I'm wondering about the two different return codes here. Under what
> > circumstances will aux->attach_btf be NULL, and why is that not an
> > ENOENT error? :)
> 
> The feature makes sense to me as well.
> I don't quite see how it would get here with attach_btf == NULL.
> Maybe WARN_ON then?

right, that should be always there

> Also if we're allowing re-attach this way why exclude PROG_EXT and LSM?
> 

I was enabling just what I needed for the test, which is so far
the only use case.. I'll see if I can enable that for all of them

jirka

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ