Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-23 Thread Hannes Frederic Sowa
On Mon, Nov 23, 2015, at 20:09, John Fastabend wrote: > On 15-11-23 10:03 AM, Alexei Starovoitov wrote: > > On Mon, Nov 23, 2015 at 05:11:58PM +0100, Hannes Frederic Sowa wrote: > >> > >> Actually, that is the reason why I mentioned it, so *the admin* can see > >> something is going on. Do you

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-23 Thread John Fastabend
On 15-11-23 11:12 AM, Hannes Frederic Sowa wrote: > On Mon, Nov 23, 2015, at 20:09, John Fastabend wrote: >> On 15-11-23 10:03 AM, Alexei Starovoitov wrote: >>> On Mon, Nov 23, 2015 at 05:11:58PM +0100, Hannes Frederic Sowa wrote: Actually, that is the reason why I mentioned it, so *the

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-23 Thread Alexei Starovoitov
On Mon, Nov 23, 2015 at 05:11:58PM +0100, Hannes Frederic Sowa wrote: > > Actually, that is the reason why I mentioned it, so *the admin* can see > something is going on. Do you want to protect ebpf from root? Skynet? ;) correct. To me both root and non-root are users in the first place and they

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-23 Thread Hannes Frederic Sowa
On Sun, Nov 22, 2015, at 00:18, Alexei Starovoitov wrote: > On Fri, Nov 20, 2015 at 11:30:13AM +0100, Hannes Frederic Sowa wrote: > > Hi Alexei, > > > > > If user space can be see both 'count' and 'max_entries', it can be very > > > tempting to start assuming 'full' and 'empty' state of the map

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-23 Thread John Fastabend
On 15-11-23 10:03 AM, Alexei Starovoitov wrote: > On Mon, Nov 23, 2015 at 05:11:58PM +0100, Hannes Frederic Sowa wrote: >> >> Actually, that is the reason why I mentioned it, so *the admin* can see >> something is going on. Do you want to protect ebpf from root? Skynet? ;) > > correct. To me both

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-21 Thread Alexei Starovoitov
On Fri, Nov 20, 2015 at 11:30:13AM +0100, Hannes Frederic Sowa wrote: > Hi Alexei, > > > If user space can be see both 'count' and 'max_entries', it can be very > > tempting to start assuming 'full' and 'empty' state of the map which will > > lead to race conditions and bad design. > > bpf

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-20 Thread Hannes Frederic Sowa
Hi Alexei, On Fri, Nov 20, 2015, at 04:30, Alexei Starovoitov wrote: > On Thu, Nov 19, 2015 at 09:12:30PM +0100, Hannes Frederic Sowa wrote: > > On Thu, Nov 19, 2015, at 19:32, Alexei Starovoitov wrote: > > > On Thu, Nov 19, 2015 at 07:19:24PM +0100, Hannes Frederic Sowa wrote: > > > > On Thu,

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-20 Thread David Miller
From: Daniel Borkmann Date: Thu, 19 Nov 2015 11:56:22 +0100 > Add a handler for show_fdinfo() to be used by the anon-inodes > backend for eBPF maps, and dump the map specification there. Not > only useful for admins, but also it provides a minimal way to > compare specs

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Daniel Borkmann
On 11/19/2015 07:19 PM, Hannes Frederic Sowa wrote: On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: Add a handler for show_fdinfo() to be used by the anon-inodes backend for eBPF maps, and dump the map specification there. Not only useful for admins, but also it provides a minimal way to

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Hannes Frederic Sowa
On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: > Add a handler for show_fdinfo() to be used by the anon-inodes > backend for eBPF maps, and dump the map specification there. Not > only useful for admins, but also it provides a minimal way to > compare specs from ELF vs pinned object. > >

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Alexei Starovoitov
On Thu, Nov 19, 2015 at 07:19:24PM +0100, Hannes Frederic Sowa wrote: > On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: > > Add a handler for show_fdinfo() to be used by the anon-inodes > > backend for eBPF maps, and dump the map specification there. Not > > only useful for admins, but also

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Alexei Starovoitov
On Thu, Nov 19, 2015 at 07:36:10PM +0100, Daniel Borkmann wrote: > On 11/19/2015 07:19 PM, Hannes Frederic Sowa wrote: > >On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: > >>Add a handler for show_fdinfo() to be used by the anon-inodes > >>backend for eBPF maps, and dump the map

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Hannes Frederic Sowa
On Thu, Nov 19, 2015, at 19:32, Alexei Starovoitov wrote: > On Thu, Nov 19, 2015 at 07:19:24PM +0100, Hannes Frederic Sowa wrote: > > On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: > > > Add a handler for show_fdinfo() to be used by the anon-inodes > > > backend for eBPF maps, and dump the

[PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Daniel Borkmann
Add a handler for show_fdinfo() to be used by the anon-inodes backend for eBPF maps, and dump the map specification there. Not only useful for admins, but also it provides a minimal way to compare specs from ELF vs pinned object. Signed-off-by: Daniel Borkmann ---

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Alexei Starovoitov
On Thu, Nov 19, 2015 at 09:12:30PM +0100, Hannes Frederic Sowa wrote: > On Thu, Nov 19, 2015, at 19:32, Alexei Starovoitov wrote: > > On Thu, Nov 19, 2015 at 07:19:24PM +0100, Hannes Frederic Sowa wrote: > > > On Thu, Nov 19, 2015, at 11:56, Daniel Borkmann wrote: > > > > Add a handler for

Re: [PATCH net-next] bpf: add show_fdinfo handler for maps

2015-11-19 Thread Alexei Starovoitov
On Thu, Nov 19, 2015 at 11:56:22AM +0100, Daniel Borkmann wrote: > Add a handler for show_fdinfo() to be used by the anon-inodes > backend for eBPF maps, and dump the map specification there. Not > only useful for admins, but also it provides a minimal way to > compare specs from ELF vs pinned