public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@kernel.org>
To: Alexei Starovoitov <ast@plumgrid.com>
Cc: "Steven Rostedt" <rostedt@goodmis.org>,
	"Peter Zijlstra" <a.p.zijlstra@chello.nl>,
	"H. Peter Anvin" <hpa@zytor.com>,
	"Thomas Gleixner" <tglx@linutronix.de>,
	"Masami Hiramatsu" <masami.hiramatsu.pt@hitachi.com>,
	"Tom Zanussi" <tom.zanussi@linux.intel.com>,
	"Jovi Zhangwei" <jovi.zhangwei@gmail.com>,
	"Eric Dumazet" <edumazet@google.com>,
	linux-kernel@vger.kernel.org,
	"Linus Torvalds" <torvalds@linux-foundation.org>,
	"Andrew Morton" <akpm@linux-foundation.org>,
	"Frédéric Weisbecker" <fweisbec@gmail.com>,
	"Arnaldo Carvalho de Melo" <acme@infradead.org>,
	"Tom Zanussi" <tzanussi@gmail.com>,
	"Pekka Enberg" <penberg@iki.fi>,
	"David S. Miller" <davem@davemloft.net>,
	"Arjan van de Ven" <arjan@infradead.org>,
	"Christoph Hellwig" <hch@infradead.org>
Subject: Re: [RFC PATCH tip 0/5] tracing filters with BPF
Date: Thu, 5 Dec 2013 11:38:40 +0100	[thread overview]
Message-ID: <20131205103840.GA20283@gmail.com> (raw)
In-Reply-To: <CAMEtUuwMGwQEtX4p1RyNTSZBA_9j-XQ4aEtM7L5hrqPkS2szfw@mail.gmail.com>


* Alexei Starovoitov <ast@plumgrid.com> wrote:

> > I mean more than that, I mean the licensing of BFP filters a user 
> > can find on his own system's kernel should be very clear: by the 
> > act of loading a BFP script into the kernel the user doing the 
> > 'upload' gives permission for it to be redistributed on 
> > kernel-compatible license terms.
> >
> > The easiest way to achieve that is to make sure that all loaded 
> > BFP scripts are 'registered' and are dumpable, viewable and 
> > reusable. That's good for debugging and it's good for 
> > transparency.
> >
> > This means a minimal BFP decoder will have to be in the kernel as 
> > well, but that's OK, we actually have several x86 instruction 
> > decoder in the kernel already, so there's no complexity threshold.
> 
> sure. there is pr_info_bpf_insn() in bpf_run.c that dumps bpf insn in
> human readable format.
> I'll hook it up to trace_seq, so that "cat
> /sys/kernel/debug/.../filter" will dump it.
> 
> Also I'm thinking to add 'license_string' section to bpf binary format
> and call license_is_gpl_compatible() on it during load.
> If false, then just reject it…. not even messing with taint flags...
> That would be way stronger indication of bpf licensing terms than what
> we have for .ko

But will BFP tools generate such gpl-compatible license tags by 
default? If yes then this might work, combined with the facility 
below. If not then it's just a nuisance to users.

Also, 'tainting' is a non-issue here, as we don't want the kernel to 
load license-incompatible scripts at all. This should be made clear in 
the design of the facility and the tooling itself.

> >> wow. I guess if the whole thing takes off, we would need an 
> >> in-kernel directory to store upstreamed bpf filters as well :)
> >
> > I see no reason why not, but more importantly all currently loaded 
> > BFP scripts should be dumpable, displayable and reusable in a 
> > kernel license compatible fashion.
> 
> ok. will add global bpf list as well (was hesitating to do something 
> like this because of central lock)

A lock + list is no big issue here I think, we do such central lookup 
locks all the time. If it ever becomes measurable it can be made 
scalable via numerous techniques.

> and something in debugfs that dumps bodies of all currently loaded 
> filters.
> 
> Will that solve the concern?

My concern would be solved by adding a facility to always be able to 
dump source code as well, i.e. trivially transform it to C or so, so 
that people can review it - or just edit it on the fly, recompile and 
reinsert? Most BFP scripts ought to be pretty simple.

(For example the most common way to load OpenGL shaders is to load the 
GLSL source code and that source code can be queried after insertion 
as well, so this is not an unusual model for small plugin-alike 
scriptlets.)

Thanks,

	Ingo

  reply	other threads:[~2013-12-05 10:38 UTC|newest]

Thread overview: 65+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03  4:28 [RFC PATCH tip 0/5] tracing filters with BPF Alexei Starovoitov
2013-12-03  4:28 ` [RFC PATCH tip 1/5] Extended BPF core framework Alexei Starovoitov
2013-12-03  4:28 ` [RFC PATCH tip 2/5] Extended BPF JIT for x86-64 Alexei Starovoitov
2013-12-03  4:28 ` [RFC PATCH tip 3/5] Extended BPF (64-bit BPF) design document Alexei Starovoitov
2013-12-03 17:01   ` H. Peter Anvin
2013-12-03 19:59     ` Alexei Starovoitov
2013-12-03 20:41       ` Frank Ch. Eigler
2013-12-03 21:31         ` Alexei Starovoitov
2013-12-04  9:24           ` Ingo Molnar
2013-12-03  4:28 ` [RFC PATCH tip 4/5] use BPF in tracing filters Alexei Starovoitov
2013-12-04  0:48   ` Masami Hiramatsu
2013-12-04  1:11     ` Steven Rostedt
2013-12-05  0:05       ` Masami Hiramatsu
2013-12-05  5:11         ` Alexei Starovoitov
2013-12-06  8:43           ` Masami Hiramatsu
2013-12-06 10:05             ` Jovi Zhangwei
2013-12-06 23:48               ` Masami Hiramatsu
2013-12-08 18:22                 ` Frank Ch. Eigler
2013-12-09 10:12                   ` Masami Hiramatsu
2013-12-03  4:28 ` [RFC PATCH tip 5/5] tracing filter examples in BPF Alexei Starovoitov
2013-12-04  0:35   ` Jonathan Corbet
2013-12-04  1:21     ` Alexei Starovoitov
2013-12-03  9:16 ` [RFC PATCH tip 0/5] tracing filters with BPF Ingo Molnar
2013-12-03 15:33   ` Steven Rostedt
2013-12-03 18:26     ` Alexei Starovoitov
2013-12-04  1:13       ` Masami Hiramatsu
2013-12-09  7:29         ` Namhyung Kim
2013-12-09  9:51           ` Masami Hiramatsu
2013-12-03 18:06   ` Alexei Starovoitov
2013-12-04  9:34     ` Ingo Molnar
2013-12-04 17:36       ` Alexei Starovoitov
2013-12-05 10:38         ` Ingo Molnar [this message]
2013-12-06  5:43           ` Alexei Starovoitov
2013-12-03 10:34 ` Masami Hiramatsu
2013-12-04  0:01 ` Andi Kleen
2013-12-04  3:09   ` Alexei Starovoitov
2013-12-05  4:40     ` Alexei Starovoitov
2013-12-05 10:41       ` Ingo Molnar
2013-12-05 13:46         ` Steven Rostedt
2013-12-05 22:36           ` Alexei Starovoitov
2013-12-05 23:37             ` Steven Rostedt
2013-12-06  4:49               ` Alexei Starovoitov
2013-12-10 15:47                 ` Ingo Molnar
2013-12-11  2:32                   ` Alexei Starovoitov
2013-12-11  3:35                     ` Masami Hiramatsu
2013-12-12  2:48                       ` Alexei Starovoitov
2013-12-05 16:11       ` Frank Ch. Eigler
2013-12-05 19:43         ` Alexei Starovoitov
2013-12-06  0:14       ` Andi Kleen
2013-12-06  1:10         ` H. Peter Anvin
2013-12-06  1:20           ` Andi Kleen
2013-12-06  1:28             ` H. Peter Anvin
2013-12-06 21:43               ` Frank Ch. Eigler
2013-12-06  5:16             ` Alexei Starovoitov
2013-12-06 23:54               ` Masami Hiramatsu
2013-12-07  1:01                 ` Alexei Starovoitov
2013-12-06  5:46             ` Jovi Zhangwei
2013-12-07  1:12             ` Alexei Starovoitov
2013-12-07 16:53               ` Jovi Zhangwei
2013-12-06  5:19       ` Jovi Zhangwei
2013-12-06 23:58         ` Masami Hiramatsu
2013-12-07 16:21           ` Jovi Zhangwei
2013-12-09  4:59             ` Masami Hiramatsu
2013-12-06  6:17       ` Jovi Zhangwei
2013-12-05 16:31   ` Frank Ch. Eigler

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131205103840.GA20283@gmail.com \
    --to=mingo@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=arjan@infradead.org \
    --cc=ast@plumgrid.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=fweisbec@gmail.com \
    --cc=hch@infradead.org \
    --cc=hpa@zytor.com \
    --cc=jovi.zhangwei@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=penberg@iki.fi \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=tom.zanussi@linux.intel.com \
    --cc=torvalds@linux-foundation.org \
    --cc=tzanussi@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox