Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1469487pxu; Thu, 17 Dec 2020 10:38:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJx6ddGE44zid6c5RuyFojK5iz7Ppod2pRGdHrkfKwcVQDf54HVtxQvE1zX0emW3Axw2vXUe X-Received: by 2002:a50:f392:: with SMTP id g18mr730515edm.306.1608230301578; Thu, 17 Dec 2020 10:38:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608230301; cv=none; d=google.com; s=arc-20160816; b=n3naPMD4ArtZcbDHQT7tfvymrwtC1cuCA1/KFfKXYB41kzGnAkR51YtGWs4czfa+c3 0TLNWtHAw9PQ5z90o/I4faWyYYYetDmreMMr/vnVE+JCHIXwbHYrtC308HaLveKdFWaV k5BPgmxwrP2/fvFFtYVQlHL7JpwzBbQp/aeTv8VNrGdvDt+Myxh0CUpYeOZ2Knuh3nnF 7MfRVbJ1Nd+1XH/Ra4TExnlJDCOr0W9Th8l20NKJ9ovp/tIOrXtPH+fRXpQ7mvRg0kZo 7TKEQ10lTWJkzpxkS3PNA0iGqqhJ1OsYhbJ+Uczm+ecv45fmfQAIvzjRPD7/JMnKnbsl kVYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=im+tZE/kWm/ZYSPYhJ4SO9Qym9+PRjpn700kp4DBAS8=; b=ZoLQIOyx/j4z3hkCL6J2Ln61dpYCR4557aRhxcc5A7XVlVu6nREoZAV2yumwAbIi57 Q1jqmkNalPj9j73sBMfpAXb4tbDbMdKbS/Ac74C4/hBZFeMfnqAylKY0Pj74DKQprCSe 6IEIGY+n0EujxCZFAzgfc9I8O6q7O8NJG+Kx5CmMQ7g+MclnI/WJUrBg+zYCFxzNo7M2 s1hFSsJVaPMW2iA6VsbKha5oW3+QpFilIHUoQb2hnTYmjis+AHDp9iIlcbTMvmXw54Pa hIAnGOZxXjUfsdsYVLR+DX2IpGECUB0IOVHxh9lU6h+rED3dOpS6A84AJlVQf/+NaIly b/dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=FQzovURv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a15si3584537eju.355.2020.12.17.10.37.59; Thu, 17 Dec 2020 10:38:21 -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=@gmail.com header.s=20161025 header.b=FQzovURv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729069AbgLQSfb (ORCPT + 99 others); Thu, 17 Dec 2020 13:35:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46158 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728143AbgLQSfb (ORCPT ); Thu, 17 Dec 2020 13:35:31 -0500 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D357C061794; Thu, 17 Dec 2020 10:34:50 -0800 (PST) Received: by mail-pl1-x630.google.com with SMTP id b8so9627800plx.0; Thu, 17 Dec 2020 10:34:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=im+tZE/kWm/ZYSPYhJ4SO9Qym9+PRjpn700kp4DBAS8=; b=FQzovURv8bA6Lx3cQIIXpJewCy4TM5boS6zU16dq/LKS3boHJ4pUrZApa66UZzb/+c RpT2UlDCXIaqUTTBnin9bzjgxz4HrIkSj97aiBbvJKVnHxZ0Oo3YwkJ3AxPNs7uLB3WE JAREWoaAiCNffkYS9FPXb6ATVq0H8eUa/AQ1UKztU75+MN0V/O0l+JB1AgiadqzujsgL tzPsT0upVO9DuFoM7lrsOoQ7jbVdb/4hzOfnymU3D3NrachozPpPW9OLL3ec/IuBIw2X 7eIGg20lBao9pO9kDnSL2pMaAQYyw+vwjzt3AhfD8+9+kEYz2ogPFaH+qX5N+moHaDT4 g5OQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=im+tZE/kWm/ZYSPYhJ4SO9Qym9+PRjpn700kp4DBAS8=; b=KTz9SWSvl7oJp7duowr/r2wyBK9OgmppdGaZvKUw7RADRCQdFja/ia+JTOPWdPrHrT KlG6EAphjvvXNmmoIii9sV7nr0EZA3YzsuRaDJGd4tcbVM8YhOcJFg0HYjvWvt8lq4AC kpOITR14fJD/ISe68O4uBj0mWn+1vXO/13jEk9FVT42KWY4Fjyx9RjuZi/UZkGzqsGvh xDv9xLTRMvGPMNg1I1yblu7Gf2gMBvqJYp1ctW7QhcNDgKst+KUBtGX3DlF7E1D1G92K a69MoTSesbN8TariaIYQrb8NEcMBckiE2/oITiVoDIQINydw2zyIfO1FqqrgCY/9GQdd xjpw== X-Gm-Message-State: AOAM530hxRG7wiTWiS4JOt/zYtptC1YxFB5B/Vv1TFh18hKxxOkEQYmE lTXQTYYjjntnHmcN7lc0PKYsOigLLM145f5MfXI= X-Received: by 2002:a17:90a:3cc6:: with SMTP id k6mr494700pjd.204.1608230090020; Thu, 17 Dec 2020 10:34:50 -0800 (PST) MIME-Version: 1.0 References: <4706b0ff81f28b498c9012fd3517fe88319e7c42.1602431034.git.yifeifz2@illinois.edu> In-Reply-To: From: YiFei Zhu Date: Thu, 17 Dec 2020 12:34:39 -0600 Message-ID: Subject: Re: [PATCH v5 seccomp 5/5] seccomp/cache: Report cache data through /proc/pid/seccomp_cache To: Geert Uytterhoeven Cc: Linux Containers , YiFei Zhu , bpf , Linux Kernel Mailing List , Aleksa Sarai , Andrea Arcangeli , Andy Lutomirski , David Laight , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Jann Horn , Josep Torrellas , Kees Cook , Tianyin Xu , Tobin Feldman-Fitzthum , Tycho Andersen , Valentin Rothberg , Will Drewry Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 17, 2020 at 6:14 AM Geert Uytterhoeven wrote: > Should there be a dependency on SECCOMP_ARCH_NATIVE? > Should all architectures that implement seccomp have this? > > E.g. mips does select HAVE_ARCH_SECCOMP_FILTER, but doesn't > have SECCOMP_ARCH_NATIVE? > > (noticed with preliminary out-of-tree seccomp implementation for m68k, > which doesn't have SECCOMP_ARCH_NATIVE Hi Geert You are correct. This specific patch in this series was not applied, and this was addressed in a follow up patch series [1]. MIPS does not define SECCOMP_ARCH_NATIVE because the bitmap expects syscall numbers to start from 0, whereas MIPS does not (defines CONFIG_HAVE_SPARSE_SYSCALL_NR). The follow up patch makes it so that any arch with HAVE_SPARSE_SYSCALL_NR (currently just MIPS) cannot have CONFIG_SECCOMP_CACHE_DEBUG on, by the depend on clause. I see that you are doing an out of tree seccomp implementation for m68k. Assuming unchanged arch/xtensa/include/asm/syscall.h, something like this to arch/m68k/include/asm/seccomp.h should make it work: #define SECCOMP_ARCH_NATIVE AUDIT_ARCH_M68K #define SECCOMP_ARCH_NATIVE_NR NR_syscalls #define SECCOMP_ARCH_NATIVE_NAME "m68k" If the file does not exist already, arch/xtensa/include/asm/seccomp.h is a good example of how the file should look like, and remember to remove `generic-y += seccomp.h` from arch/m68k/include/asm/Kbuild. [1] https://lore.kernel.org/lkml/cover.1605101222.git.yifeifz2@illinois.edu/T/ YiFei Zhu