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.8 required=3.0 tests=BAYES_00, 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 4ABDAC4361B for ; Fri, 18 Dec 2020 12:36:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 17AB82395C for ; Fri, 18 Dec 2020 12:36:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725954AbgLRMgP (ORCPT ); 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-Google-Smtp-Source: ABdhPJxfxl8yKvwDyX+PZdHV9q/oXdW8TwcExmFO7cyFXUgs7tlC+yddRm9fZPOke+BiKpjClwWCzDNXD7sWbAFO+/Y= 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: bpf@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