Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2058128pxu; Fri, 18 Dec 2020 04:39:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJwtE46jFyJKbJ95gafUbx8+P+BsFEH58s+FXyxRtmzBY/YRIqiRxIrTY/LoO6LWMR/xL4p8 X-Received: by 2002:a17:906:5952:: with SMTP id g18mr3697773ejr.506.1608295191711; Fri, 18 Dec 2020 04:39:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608295191; cv=none; d=google.com; s=arc-20160816; b=hG1J/ETr95S4pX24D06ee9nn3lYrrzLaePw1tHtix1rRyevdBJUracXqAuw+UlpiUT WyEKtW9p+Qp4PpRo55ib2etwIz7m77JhRRCeGGdOm37HXDczWS6+ltI9lNtrBjjQIiqN u9lnZd9mZVrOdLHXUoafudXivEt+XqL91rzhLql30AMGX9K91wzgBCsQm/FG3QtXri3K tz/+I1vpKwBd8mh2zqPWPXRK9V2RNvoEmCh1E1FR63xxt8C/rOtTnhgilp6dA6DII9gL grlMO84tKEhiqqy2wI4QQtKYt5IcEOOaqIdwzUmteT2ckkE6Nh65THDWY4mEb+dUrCVo A2WQ== 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; bh=6DkNUPLV4pty/yUPNr3zH12sGf0mqEAZH7OQh5zf4K8=; b=K/pNuFBbb2rr8ZCDkzOM8apwgGvxVyUX9qoIoAquZ0KXYbNkjKlk5MbZBXwsmMWZtb TBIzkEEZ8n2SwlF//kYrLwKB15TwOubApzaHppD5Qbk4718tnY5/CTGwEYW6EmdQa/ot 5kdnXoNrFHTUWACgs+9TbQspOb7wZOIOlVal+OVdnv96qs60ROLRCsXrwTmac8A6Cewm WzmS/X7xzSZSLp4NxOng+lyzxhcBh5p6foPtZylsbEwvNRKGaHXM0228rrkegrMmn8Sw wh4m3Zd6k7sIve/bT+Nfu+LKMf8amFR/DkhEcuOHq6EtFmbVLCLgxLDmzjVVvF4a8Hmk dTkA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id co1si6119725edb.571.2020.12.18.04.39.29; Fri, 18 Dec 2020 04:39:51 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726010AbgLRMgP (ORCPT + 99 others); Fri, 18 Dec 2020 07:36:15 -0500 Received: from mail-ot1-f47.google.com ([209.85.210.47]:39399 "EHLO mail-ot1-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725947AbgLRMgO (ORCPT ); Fri, 18 Dec 2020 07:36:14 -0500 Received: by mail-ot1-f47.google.com with SMTP id d8so1741468otq.6; Fri, 18 Dec 2020 04:35:59 -0800 (PST) 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=6DkNUPLV4pty/yUPNr3zH12sGf0mqEAZH7OQh5zf4K8=; b=Cbe+ZMZ7Hv+3wvSxKwbxHFHTesx6iENh9ELFCCka4qaJcI9pdnGy3EVVUH9z8Vy0A6 ddD7tO4nd0Y82lp/7iIsvsmfdssW5nV20uAi451qsU8dYKqNGBKFLXIsOQjGsy+CEmVe qN9HeFOmF68Xdos0ZwrGEN3ZLCmBbudznEp3p695TUGXa3Hm3iVsRgNW0hxHbXpsXk1m G8imU/OD9pAMTU8bI7jUwaybX4HyhjyIWnCvR9pVUGalHCJoy9A3IZdaLfTSyjhnRGwa 7iD9Z2rlPqOladaw0amBhuItZbeKxz/IgN8X9Cz4zEEIeERosFbeA0LmXvYo0Lzrws63 lJgw== X-Gm-Message-State: AOAM5308e1iUxAwzs92iJK7WPGM7vCF59dbeTw4qlz+0thm3mL3h9nck N2foC/Y1Ox9UwYozPfP/FNU7U1HFHLZpDBBGEKiiu/jD X-Received: by 2002:a05:6830:210a:: with SMTP id i10mr2604996otc.145.1608294933980; Fri, 18 Dec 2020 04:35:33 -0800 (PST) MIME-Version: 1.0 References: <4706b0ff81f28b498c9012fd3517fe88319e7c42.1602431034.git.yifeifz2@illinois.edu> In-Reply-To: From: Geert Uytterhoeven Date: Fri, 18 Dec 2020 13:35:21 +0100 Message-ID: Subject: Re: [PATCH v5 seccomp 5/5] seccomp/cache: Report cache data through /proc/pid/seccomp_cache To: YiFei Zhu 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 Hi YiFei, On Thu, Dec 17, 2020 at 7:34 PM YiFei Zhu wrote: > 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 > > 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/ Thank you for your extensive explanation. Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds