From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752950AbbCWRuX (ORCPT ); Mon, 23 Mar 2015 13:50:23 -0400 Received: from mail-qg0-f41.google.com ([209.85.192.41]:35688 "EHLO mail-qg0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752465AbbCWRuU (ORCPT ); Mon, 23 Mar 2015 13:50:20 -0400 Message-ID: <55105251.6070807@plumgrid.com> Date: Mon, 23 Mar 2015 10:50:09 -0700 From: Alexei Starovoitov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Ingo Molnar , David Laight CC: Steven Rostedt , Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Masami Hiramatsu , "David S. Miller" , Daniel Borkmann , Peter Zijlstra , "linux-api@vger.kernel.org" , "netdev@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v10 tip 5/9] tracing: allow BPF programs to call bpf_trace_printk() References: <1427053150-32213-1-git-send-email-ast@plumgrid.com> <1427053150-32213-6-git-send-email-ast@plumgrid.com> <063D6719AE5E284EB5DD2968C1650D6D1CB07731@AcuExch.aculab.com> <20150323120753.GA22560@gmail.com> In-Reply-To: <20150323120753.GA22560@gmail.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 3/23/15 5:07 AM, Ingo Molnar wrote: > > * David Laight wrote: > >> From: Alexei Starovoitov >>> Debugging of BPF programs needs some form of printk from the program, >>> so let programs call limited trace_printk() with %d %u %x %p modifiers only. >> >> Should anyone be allowed to use BPF programs to determine the kernel >> addresses of any items? >> Looks as though it is leaking kernel addresses to userspace. >> Note that the problem is with the arguments, not the format string. > > All of these are privileged operations - inherent if you are trying to > debug the kernel. yep. There is a plan to add 'pointer leak detector' to bpf verifier and 'constant blinding' pass, so in the future we may let unprivileged users load programs. seccomp will be first such user. But it will take long time.