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=-2.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 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 0856BC432C1 for ; Tue, 24 Sep 2019 06:30:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id DA0142146E for ; Tue, 24 Sep 2019 06:30:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2440537AbfIXGal (ORCPT ); Tue, 24 Sep 2019 02:30:41 -0400 Received: from youngberry.canonical.com ([91.189.89.112]:37073 "EHLO youngberry.canonical.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2440525AbfIXGal (ORCPT ); Tue, 24 Sep 2019 02:30:41 -0400 Received: from [89.27.154.14] (helo=wittgenstein) by youngberry.canonical.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1iCeLN-0008Ni-0B; Tue, 24 Sep 2019 06:30:37 +0000 Date: Tue, 24 Sep 2019 08:30:36 +0200 From: Christian Brauner To: Andy Lutomirski Cc: Borislav Petkov , LKML , Thomas Gleixner , Kees Cook , Will Drewry , Oleg Nesterov , linux-arm-kernel , Parisc List , linux-s390 , linux-um@lists.infradead.org, X86 ML Subject: Re: [PATCH] seccomp: remove unused arg from secure_computing() Message-ID: <20190924063035.n3dmryhn6cb52ida@wittgenstein> References: <20190920131907.6886-1-christian.brauner@ubuntu.com> <20190923094916.GB15355@zn.tnic> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20180716 Sender: linux-parisc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org On Mon, Sep 23, 2019 at 11:41:59AM -0700, Andy Lutomirski wrote: > On Mon, Sep 23, 2019 at 2:49 AM Borislav Petkov wrote: > > > > On Fri, Sep 20, 2019 at 03:19:09PM +0200, Christian Brauner wrote: > > > While touching seccomp code I realized that the struct seccomp_data > > > argument to secure_computing() seems to be unused by all current > > > callers. So let's remove it unless there is some subtlety I missed. > > > Note, I only tested this on x86. > > > > What was amluto thinking in > > > > 2f275de5d1ed ("seccomp: Add a seccomp_data parameter secure_computing()") > > IIRC there was a period of time in which x86 used secure_computing() > for normal syscalls, and it was a good deal faster to have the arch > code supply seccomp_data. x86 no longer works like this, and syscalls > aren't fast anymore ayway :( I started looking at this and actually had a slightly bigger cleanup in mind. It seems odd that we have secure_computing() and __secure_computing(). Especially in the mips and x86 case. From what I can tell they could both rely on secure_computing() and don't need __secure_computing(). If I can make those changes, we can make __secure_computing() static and have only a single function secure_computing() that is used by all arches which would make this code simpler. Apparenly mips once switched from secure_computing() to __secure_computing() because of bpf and tracepoints. The last change to this was: commit 3d729deaf287c43e415c5d791c9ac8414dbeff70 Author: James Hogan Date: Fri Aug 11 21:56:50 2017 +0100 MIPS: seccomp: Fix indirect syscall args which references a broken samples/bpf/tracex5 test. But in the thread to this last change Kees and others were less than sure that this makes sense. So I'm not sure. Maybe I should just try and send it out... Christian