From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73B79C433E2 for ; Fri, 11 Sep 2020 09:46:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3100821D92 for ; Fri, 11 Sep 2020 09:46:45 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="AR8Q0ajz" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725710AbgIKJqm (ORCPT ); Fri, 11 Sep 2020 05:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37490 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725554AbgIKJqm (ORCPT ); Fri, 11 Sep 2020 05:46:42 -0400 Received: from merlin.infradead.org (merlin.infradead.org [IPv6:2001:8b0:10b:1231::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BCCB3C061573; Fri, 11 Sep 2020 02:46:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NEEs3sphOm5r5iiLL/EE/1iKkrXLyqvJjoXYEVBIkeA=; b=AR8Q0ajzeTXTHvxHzwx2/HKp6G nYtbzV0y21U6m9kM52QxCp1XYwqxhxJFNapZLNM2uZNUEYq2pCspiNmqyti2WUOiw1MXIjogYTzSB Ry5X9KNf3rQ88rMOf7/BoNucuk/FS5/zy/OIRofIII6eyvn2uX3o3gNuKb/7wrHq1QlZCiUbnRgvP DSHkpt0OrpPIJAv/BDXLMxe8xqKxWekRMHopWL3ZiFbCc83w0ksvAmAbDa0xo/88/r7MVCU58Wren 4s7Gw/g3rNJyVR8F1f6TNSLWTD5j8JVvEmXIq13e2ZxhFkY7CG/CQM4FH1rRfW3XygP3bISzsQdjU szKWpiFg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=noisy.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kGfdc-0005tL-Eg; Fri, 11 Sep 2020 09:46:36 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id F0A96305815; Fri, 11 Sep 2020 11:46:34 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id DBFD72B06B003; Fri, 11 Sep 2020 11:46:34 +0200 (CEST) Date: Fri, 11 Sep 2020 11:46:34 +0200 From: peterz@infradead.org To: Gabriel Krisman Bertazi Cc: luto@kernel.org, tglx@linutronix.de, keescook@chromium.org, x86@kernel.org, linux-kernel@vger.kernel.org, linux-api@vger.kernel.org, willy@infradead.org, linux-kselftest@vger.kernel.org, shuah@kernel.org, kernel@collabora.com Subject: Re: [PATCH v6 6/9] kernel: entry: Support Syscall User Dispatch for common syscall entry Message-ID: <20200911094634.GG1362448@hirez.programming.kicks-ass.net> References: <20200904203147.2908430-1-krisman@collabora.com> <20200904203147.2908430-7-krisman@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200904203147.2908430-7-krisman@collabora.com> Sender: linux-api-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-api@vger.kernel.org On Fri, Sep 04, 2020 at 04:31:44PM -0400, Gabriel Krisman Bertazi wrote: > Syscall User Dispatch (SUD) must take precedence over seccomp, since the > use case is emulation (it can be invoked with a different ABI) such that > seccomp filtering by syscall number doesn't make sense in the first > place. In addition, either the syscall is dispatched back to userspace, > in which case there is no resource for seccomp to protect, or the > syscall will be executed, and seccomp will execute next. > > Regarding ptrace, I experimented with before and after, and while the > same ABI argument applies, I felt it was easier to debug if I let ptrace > happen for syscalls that are dispatched back to userspace. In addition, > doing it after ptrace makes the code in syscall_exit_work slightly > simpler, since it doesn't require special handling for this feature. I think I'm with Andy that this should be before ptrace(). ptrace() users will attempt to interpret things like they're regular syscalls, and that's definitely not the case.