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]
Message-ID: <20181107131223.02f1c16c@cakuba.netronome.com>
Date:   Wed, 7 Nov 2018 13:12:23 -0800
From:   Jakub Kicinski <jakub.kicinski@...ronome.com>
To:     Stanislav Fomichev <sdf@...ichev.me>
Cc:     Stanislav Fomichev <sdf@...gle.com>, netdev@...r.kernel.org,
        linux-kselftest@...r.kernel.org, ast@...nel.org,
        daniel@...earbox.net, shuah@...nel.org,
        quentin.monnet@...ronome.com, guro@...com,
        jiong.wang@...ronome.com, bhole_prashant_q7@....ntt.co.jp,
        john.fastabend@...il.com, jbenc@...hat.com,
        treeze.taeung@...il.com, yhs@...com, osk@...com,
        sandipan@...ux.vnet.ibm.com
Subject: Re: [PATCH bpf-next 2/2] bpftool: support loading flow dissector

On Wed, 7 Nov 2018 13:00:09 -0800, Stanislav Fomichev wrote:
> > > +	}
> > > +
> > > +	if (attr.prog_type == BPF_PROG_TYPE_FLOW_DISSECTOR) {
> > > +		err = build_flow_dissector_jmp_table(obj, prog, "jmp_table");
> > > +		if (err) {
> > > +			p_err("failed to build flow dissector jump table");
> > > +			goto err_close_obj;
> > > +		}
> > > +		/* flow dissector consist of multiple programs,
> > > +		 * we want to pin them all  
> > 
> > Why pin them all shouldn't the main program be the only one pinned?  
> If I pin only the main program, the tail ones disappear from the jmp_table map
> when bpftool exits.
> Am I missing something?
> Should BPF_MAP_TYPE_PROG_ARRAY hold the referenced progs?

It does.

# bpftool map create /sys/fs/bpf/map \
	type prog_array key 4 value 4 entries 4 \
	name tail_call_map
# bpftool prog load perf_event_output_stack.o /sys/fs/bpf/prog \
	 type xdp 
# bpftool map update pinned /sys/fs/bpf/map \
	key 0 0 0 0 \
	value pinned /sys/fs/bpf/prog
# bpftool prog 
11: xdp  name xdp_prog1  tag 6f1b482b27443edf  gpl
	loaded_at 2018-11-07T13:09:20-0800  uid 0
	xlated 144B  jited 130B  memlock 4096B  map_ids 14
# rm /sys/fs/bpf/prog
# bpftool prog 
11: xdp  name xdp_prog1  tag 6f1b482b27443edf  gpl
	loaded_at 2018-11-07T13:09:20-0800  uid 0
	xlated 144B  jited 130B  memlock 4096B  map_ids 14
# rm /sys/fs/bpf/map 
# bpftool prog 
# bpftool prog show id 11
Error: get by id (11): No such file or directory


I think we should remove all this auto tail call construction unless
we have solid annotations in the elf file which can clearly guide the
loader.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ