From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754547Ab2ALRab (ORCPT ); Thu, 12 Jan 2012 12:30:31 -0500 Received: from mx1.redhat.com ([209.132.183.28]:6441 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754089Ab2ALRa2 (ORCPT ); Thu, 12 Jan 2012 12:30:28 -0500 Date: Thu, 12 Jan 2012 18:23:15 +0100 From: Oleg Nesterov To: Will Drewry Cc: linux-kernel@vger.kernel.org, keescook@chromium.org, john.johansen@canonical.com, serge.hallyn@canonical.com, coreyb@linux.vnet.ibm.com, pmoore@redhat.com, eparis@redhat.com, djm@mindrot.org, torvalds@linux-foundation.org, segoon@openwall.com, rostedt@goodmis.org, jmorris@namei.org, scarybeasts@gmail.com, avi@redhat.com, penberg@cs.helsinki.fi, viro@zeniv.linux.org.uk, luto@mit.edu, mingo@elte.hu, akpm@linux-foundation.org, khilman@ti.com, borislav.petkov@amd.com, amwang@redhat.com, ak@linux.intel.com, eric.dumazet@gmail.com, gregkh@suse.de, dhowells@redhat.com, daniel.lezcano@free.fr, linux-fsdevel@vger.kernel.org, linux-security-module@vger.kernel.org, olofj@chromium.org, mhalcrow@google.com, dlaor@redhat.com Subject: Re: [RFC,PATCH 1/2] seccomp_filters: system call filtering using BPF Message-ID: <20120112172315.GA26295@redhat.com> References: <1326302710-9427-1-git-send-email-wad@chromium.org> <1326302710-9427-2-git-send-email-wad@chromium.org> <20120112162231.GA23960@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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 01/12, Will Drewry wrote: > > On Thu, Jan 12, 2012 at 10:22 AM, Oleg Nesterov wrote: > >> +      */ > >> +     regs = seccomp_get_regs(regs_tmp, ®s_size); > > > > Stupid question. I am sure you know what are you doing ;) and I know > > nothing about !x86 arches. > > > > But could you explain why it is designed to use user_regs_struct ? > > Why we can't simply use task_pt_regs() and avoid the (costly) regsets? > > So on x86 32, it would work since user_regs_struct == task_pt_regs > (iirc), but on x86-64 > and others, that's not true. Yes sure, I meant that userpace should use pt_regs too. > If it would be appropriate to expose pt_regs to userspace, then I'd > happily do so :) Ah, so that was the reason. But it is already exported? At least I see the "#ifndef __KERNEL__" definition in arch/x86/include/asm/ptrace.h. Once again, I am not arguing, just trying to understand. And I do not know if this definition is part of abi. Oleg.