From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751728AbbJYOnY (ORCPT ); Sun, 25 Oct 2015 10:43:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:44122 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751292AbbJYOnW (ORCPT ); Sun, 25 Oct 2015 10:43:22 -0400 Date: Sun, 25 Oct 2015 16:39:43 +0100 From: Oleg Nesterov To: Tycho Andersen Cc: Kees Cook , Alexei Starovoitov , Will Drewry , Andy Lutomirski , Pavel Emelyanov , "Serge E. Hallyn" , Daniel Borkmann , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v8] seccomp, ptrace: add support for dumping seccomp filters Message-ID: <20151025153943.GA1912@redhat.com> References: <1445370612-18843-1-git-send-email-tycho.andersen@canonical.com> <1445370612-18843-2-git-send-email-tycho.andersen@canonical.com> <20151020202024.GA5772@redhat.com> <20151020220814.GA3232@hopstrocity> <20151021185146.GA27176@redhat.com> <20151021191533.GD30729@hopstrocity> <20151021210756.GA641@redhat.com> <20151021213306.GF30729@hopstrocity> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151021213306.GF30729@hopstrocity> User-Agent: Mutt/1.5.18 (2008-05-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/21, Tycho Andersen wrote: > > > And this leads to another question... If we expect that this interface > > can change later, then perhaps PTRACE_SECCOMP_GET_FILTER should also > > dump some header before copy_to_user(fprog->filter) ? Say, just > > "unsigned long version" == 0 for now. So that we can avoid > > PTRACE_SECCOMP_GET_FILTER_V2 in future. > > So this is interesting. Like Kees mentioned, the bulk of the work > would be done by the bpf syscall. We'd still need some way to get > access to the fd itself, which we could (ab)use > PTRACE_SECCOMP_GET_FILTER for, by returning the fd + BPF_MAXINSNS (so > that it doesn't conflict with length) or something like that. Or add a > _V2 as you say. If there is some change we can make to have a nicer > interface than fd + BPF_MAXINSNS to future proof, I'm fine with making > it. Can't comment, this is up to you/Kees ;) So, just in case, let me repeat I am fine with this patch. Oleg.