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.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 C8E4FC388F7 for ; Wed, 4 Nov 2020 00:22:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7D1EA223EA for ; Wed, 4 Nov 2020 00:22:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="mPTbV2Uh" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729926AbgKDALn (ORCPT ); Tue, 3 Nov 2020 19:11:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729911AbgKDALn (ORCPT ); Tue, 3 Nov 2020 19:11:43 -0500 Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E4D01C061A49 for ; Tue, 3 Nov 2020 16:11:42 -0800 (PST) Received: by mail-pg1-x544.google.com with SMTP id h6so15022872pgk.4 for ; Tue, 03 Nov 2020 16:11:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NFjsAF4kgpQCHVIlKmgYN6bEVL36r1XibqsUv152D08=; b=mPTbV2UhVfnJP2OoJL4D5QLosesGivMu0Yj5j7pkCrVtHA6dueaCzR1JSWWklnSxS2 Wgzos2joCi+Wlp8KUeVXQhCOJbK/Z4g4eTF82BJYkvr8uaU2CIt3++/EZgLF7nCLiPmR RFfDgHAz/9hjV1ZrPMZTrZyKkXhcZM/AoX3+w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NFjsAF4kgpQCHVIlKmgYN6bEVL36r1XibqsUv152D08=; b=KXbBjRxChsg8slHtfAruwYTmt+y5bAVHSJog4tb5NmOP+8YVejtJUQZATKBdMsOGlU VYDMEWn7T7YRWugTHFZ8xqRvCih6XYMhD1sQxXzIaXYiH3XlAIV6mlB3QSTfhCKWwqFh I0JoK+0QdIkmfhI5SODUxMYzaCmGDAhTf+xB67wHEYDOX93CdJb9I0ZvA+gPx8StMyWG /00Z9Skn4I9y6zTSrAxyyeoLKaP2GwbHgCO/QE9AqGr6rrSxtBFrt7PmajlvqHrcLQRF FNmXdcYaG2KlRQbKOxLpLanLnSVZCR3BembkeJx0Krr/70BhvR2ks40vgbhQNR+b81PU tNxQ== X-Gm-Message-State: AOAM530tMU1/VG5oHoSE/xn3ydDAmIDYtsqg4vjne4TBH/n2VqJr0l+4 BJlxn6nFpfd5wrAV/F3O8s+B7g== X-Google-Smtp-Source: ABdhPJybME+aS3qtjx8JuwpcYMqCGEp0y1Q8idII2QCmSunt2ifzlNcehSCk1E6c+iZLzWwdlgTh0g== X-Received: by 2002:a17:90a:5285:: with SMTP id w5mr1762165pjh.50.1604448702345; Tue, 03 Nov 2020 16:11:42 -0800 (PST) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id j20sm118311pgl.40.2020.11.03.16.11.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Nov 2020 16:11:41 -0800 (PST) Date: Tue, 3 Nov 2020 16:11:40 -0800 From: Kees Cook To: YiFei Zhu Cc: containers@lists.linux-foundation.org, YiFei Zhu , linux-csky@vger.kernel.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, linux-xtensa@linux-xtensa.org, linux-kernel@vger.kernel.org, Aleksa Sarai , Andrea Arcangeli , Andy Lutomirski , David Laight , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Jann Horn , Josep Torrellas , Tianyin Xu , Tobin Feldman-Fitzthum , Tycho Andersen , Valentin Rothberg , Will Drewry Subject: Re: [PATCH seccomp 0/8] seccomp: add bitmap cache support on remaining arches and report cache in procfs Message-ID: <202011031606.423EC9E@keescook> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-csky@vger.kernel.org On Tue, Nov 03, 2020 at 07:42:56AM -0600, YiFei Zhu wrote: > From: YiFei Zhu > > This patch series enables bitmap cache for the remaining arches with > SECCOMP_FILTER, other than MIPS. > > I was unable to find any of the arches having subarch-specific NR_syscalls > macros, so generic NR_syscalls is used. SH's syscall_get_arch seems to > only have the 32-bit subarch implementation. I'm not sure if this is > expected. > > This series has not been tested; I have not built all the cross compilers > necessary to build test, let alone run the kernel or benchmark the > performance, so help on making sure the bitmap cache works as expected > would be appreciated. The series applies on top of Kees's for-next/seccomp > branch. Thank you! This looks good. I wonder if the different handling of little endian is worth solving -- I'm suspicious about powerpc's use of __LITTLE_ENDIAN__ vs a CONFIG, but I guess the compiler would match the target endian-ness. Regardless, it captures what the architectures are doing, and gets things standardized. > > YiFei Zhu (8): > csky: Enable seccomp architecture tracking > parisc: Enable seccomp architecture tracking I don't have compilers for these. > powerpc: Enable seccomp architecture tracking > riscv: Enable seccomp architecture tracking > s390: Enable seccomp architecture tracking These I can build-test immediately. > sh: Enable seccomp architecture tracking > xtensa: Enable seccomp architecture tracking These two are available in Ubuntu's cross compiler set, so I'll get them added to my cross-builders. > seccomp/cache: Report cache data through /proc/pid/seccomp_cache In the meantime, I'll wait a bit to see if we can get some Acks/Reviews from arch maintainers. :) -Kees > > arch/Kconfig | 15 ++++++++ > arch/csky/include/asm/Kbuild | 1 - > arch/csky/include/asm/seccomp.h | 11 ++++++ > arch/parisc/include/asm/Kbuild | 1 - > arch/parisc/include/asm/seccomp.h | 22 +++++++++++ > arch/powerpc/include/asm/seccomp.h | 21 +++++++++++ > arch/riscv/include/asm/seccomp.h | 10 +++++ > arch/s390/include/asm/seccomp.h | 9 +++++ > arch/sh/include/asm/seccomp.h | 10 +++++ > arch/xtensa/include/asm/Kbuild | 1 - > arch/xtensa/include/asm/seccomp.h | 11 ++++++ > fs/proc/base.c | 6 +++ > include/linux/seccomp.h | 7 ++++ > kernel/seccomp.c | 59 ++++++++++++++++++++++++++++++ > 14 files changed, 181 insertions(+), 3 deletions(-) > create mode 100644 arch/csky/include/asm/seccomp.h > create mode 100644 arch/parisc/include/asm/seccomp.h > create mode 100644 arch/xtensa/include/asm/seccomp.h > > > base-commit: 38c37e8fd3d2590c4234d8cfbc22158362f0eb04 > -- > 2.29.2 -- Kees Cook