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]
Date:	Thu, 17 Dec 2015 22:19:30 -0800
From:	Alexei Starovoitov <alexei.starovoitov@...il.com>
To:	"Wangnan (F)" <wangnan0@...wei.com>
Cc:	ast@...nel.org, agartrell@...com, acme@...hat.com,
	bblanco@...mgrid.com, daniel@...earbox.net,
	daniel.wagner@...-carit.de, davem@...emloft.net, mingo@...nel.org,
	jolsa@...nel.org, xiakaixu@...wei.com, holzheu@...ux.vnet.ibm.com,
	yang.shi@...aro.org, linux-kernel@...r.kernel.org, pi3orama@....com
Subject: Re: [PATCH 08/10] bpf samples: Add utils.[ch] for using BPF

On Fri, Dec 18, 2015 at 09:47:11AM +0800, Wangnan (F) wrote:
> 
> This is a limitation in tools/lib/bpf/libbpf.h, which has a #include
> <linux/err.h>
> in its header.
> 
> libbpf.h requires this include because its API uses ERR_PTR() to encode
> error code.
> For example, when calling bpf_object__open(), caller should use IS_ERR() to
> check its
> return value instead of compare with NULL, and use PTR_ERR() to retrive
> error number.
> 
> However, linux/err.h is not a part of uapi. To make libbpf work, one has to
> create its
> own err.h.

Why tools/include/linux/err.h is not suitable for everyone?

> Now I'm thinking provide LIBBPF_{IS_ERR,PTR_ERR}(),  in libbpf itself.

seems odd. we already have user space err.h in tools/include.

> And I don't touch the setsockopt in all patches.

ok, but where is the bit that does attach to perf_event to make trace_output work?

> Orignally they are macros defined in linux/filter.h.

no. they were never part of offical filter.h. Only in my earlier versions
of bpf patches, but we decided to drop them before they got into net-next.

> What about moving them into include/uapi/linux/filter.h ? Then
> normal user programs like those in samples/bpf can access
> them easier.

we don't want to add these macros to uapi.
Why not to add it to
tools/include/linux/filter.h
instead?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ