Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp909460pxb; Tue, 3 Nov 2020 16:22:01 -0800 (PST) X-Google-Smtp-Source: ABdhPJyGEBUk0Xx5ml7TVwxLJhNozRCySpXUzJVWWggERnAimv5dfXfPLiMOrrqrgBjGqR/5Ycz0 X-Received: by 2002:aa7:c4c2:: with SMTP id p2mr25002354edr.371.1604449320951; Tue, 03 Nov 2020 16:22:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604449320; cv=none; d=google.com; s=arc-20160816; b=OyeJtOV+8qsN4q7hOPQpbWgxZUJ/dj9uQAvjTGvNTC8rjq9di0cDXFd3S7tw8/38Hi 4Hk/6D54iMXfveaBUhpbRLRps2JsZufaLppOV5jAL5jh8vfI3f3AKF0flrp/ab16hCpS r7eP08wh4Ckli8CZQw+L9vxcldITk7k2jvv1zoLJeGniU61Ey99H36qBBNh9bd4ONv4d kMvDyiCXYp7hfD6RJae0BEEAO+y89VhncGm+sRKzC6kcKZIBPBxpPbKRnr1z5lRjZoSJ mT0LHVD684pkpKocrJMapDVTb/3Q+nhIVig1fy/QWhdVi8+0DZoWdlmwL5DJemXKpFCw X7dA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=NFjsAF4kgpQCHVIlKmgYN6bEVL36r1XibqsUv152D08=; b=qRBWxEA2TUkruz7AZIw/zUQDR6w3WFj36yKDNGVHIxuYtRZHbLwjzwrNYV8SpW8mEg 10U85dUQFO5ESeNFCKcMIEB/TfyCYF/ehTzlRF/kUUcBuQ4Q6oL1HEoXTcgEmCGaDTEU bTjeSoo1IO4pf+RpNQc+nLzTB6ne8PZpWOvwCKAXSQ8zvTe5mpUTEufdFbUjHPdC8xkG 1BBs/OlKF6cqsk/sDTaROsLjjKRpRT/DwjFWBa0mDW5CQxsCB2WdvtO17nJnSvAGBDye QOM0GpsxdLNpuBOPw3WJZf3JURl1v+VuQ4qotG2knASaD4m4eWztx+bt2Lfo61xHBqH4 i5ig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mPTbV2Uh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r1si338538ejh.137.2020.11.03.16.21.38; Tue, 03 Nov 2020 16:22:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mPTbV2Uh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729911AbgKDALn (ORCPT + 99 others); Tue, 3 Nov 2020 19:11:43 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53616 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729866AbgKDALn (ORCPT ); Tue, 3 Nov 2020 19:11:43 -0500 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAEE0C061A48 for ; Tue, 3 Nov 2020 16:11:42 -0800 (PST) Received: by mail-pg1-x543.google.com with SMTP id i7so13083401pgh.6 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=KOYhPrAIAeay7cnRpT/zXlFeLeDE60z5xT5zm6JNwrEj4xwzBfMFWyFS9Y4zsKvS7e yEN+MF38onf5gqpiFgq25zvqmFvZ9mIzuguevFiu9pD2+6G0uddPfkTqBQZVvRvxjUtf mPFcX2ALgCjJGz/mRiKYlNsa56I0Mk8lplOhLwudTlwur7rU0JRbOgeiLLSZ0cxM9T29 GTVScBVr5Byrkz88w8jsBBPW0k7qJSdbsqogVPlfm3EHZWGDhQwwEQ4hNidjcnBWRvHs Ra/bTHHVCORbfBX2xC5PaGriZhvuU2HujcbqTb0fuzgFOGhBiZsuZgU90ldbNZhMKouk LsdA== X-Gm-Message-State: AOAM5314zWQtPspeYk4ElnYqzzMHnHxZALSluW2e+YCL5VLniAyYPbA2 V0A/hw1x7KRx5ErnhTeVPbxWGg== 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-kernel@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