From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751633AbaHOT3l (ORCPT ); Fri, 15 Aug 2014 15:29:41 -0400 Received: from mail-we0-f178.google.com ([74.125.82.178]:63876 "EHLO mail-we0-f178.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751333AbaHOT3j (ORCPT ); Fri, 15 Aug 2014 15:29:39 -0400 MIME-Version: 1.0 In-Reply-To: References: <1407916658-8731-1-git-send-email-ast@plumgrid.com> <1407916658-8731-18-git-send-email-ast@plumgrid.com> Date: Fri, 15 Aug 2014 12:29:38 -0700 Message-ID: Subject: Re: [PATCH RFC v4 net-next 17/26] tracing: allow eBPF programs to be attached to events From: Alexei Starovoitov To: Andy Lutomirski Cc: "David S. Miller" , Ingo Molnar , Linus Torvalds , Steven Rostedt , Daniel Borkmann , Chema Gonzalez , Eric Dumazet , Peter Zijlstra , "H. Peter Anvin" , Andrew Morton , Kees Cook , Linux API , Network Development , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 15, 2014 at 12:20 PM, Andy Lutomirski wrote: >>> >>> I don't think that fixing this should be a prerequisite for merging, >>> since the risk is so small. Nonetheless, it would be nice. (This >>> family of attacks has lead to several root vulnerabilities in the >>> past.) >> >> Ok. I think keeping a track of pid between open and write is kinda >> ugly. > > Agreed. > > TBH, I would just add a comment to the open implementation saying > that, if unprivileged or less privileged open is allowed, then this > needs to be fixed. ok. will do. >> Should we add some new CAP flag and check it for all file >> ops? Another option is to conditionally make open() of tracing >> files as cloexec... > > That won't help. The same attack can be done with SCM_RIGHTS, and > cloexec can be cleared. ouch, can we then make ebpf FDs and may be debugfs FDs not passable at all? Otherwise it feels that generality and flexibility of FDs is becoming a burden.