Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3768302pxu; Sun, 11 Oct 2020 23:56:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwOriX3pxaRYMmhpM3tGM0pACfyA67FWAfGZRwo646Q3vhGJ5atkD/xSd2B+ZAbnqqZ5v64 X-Received: by 2002:a17:906:1dd0:: with SMTP id v16mr26230663ejh.309.1602485787811; Sun, 11 Oct 2020 23:56:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602485787; cv=none; d=google.com; s=arc-20160816; b=qlK/cG8O9YGX3VpmTHNx/bN62Bc0jT2FuDzIrsV12bxEHrtZX89OCo3ElBUfpgP6Tf rzqYBZXZhul5lH+8ahlBO9cu3zBpIVL5TnmO5jgeccYQWWiedg8o8uXDPCyUTwpfjO5l z2cjcf3q7hmd4evL1Z1c05L3Vx3VsiQdz03Hw6PZxzIYNdFCFMNsOCSfH/3UEGpF7dTp cliWbaa27VD+i9UtXblhdiBCEXlU8tuCtKrME8toGZYHKDUn3e98NG57j3DD9OqBBwMU jIZajdhCxaIAUZbFfG9y2UkDUJScAqAQu8jRl104L/IRr6zTBkDAz/u3RZp2u3JRijZn PKXg== 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=vioP1tNDAwc//TCk7A/UlbXm8YsyMW81aBUSwcUWM5M=; b=0VcfINgGggNU82FCkrVqoV3Eo9gcD9VbWS02fzk5nvy0qNECMbVS47FXA0IMkFCar9 3qcHOgIC7INDP7aA1KY6LWilyGiUUgGfSgHIcYsahWy1BIVWPE18R8/lzIEQIHVxV2RS MgDCJXRmjb7AAYAP9Oi8xerZ6gYanupukJVvaPspZEMXcQwCEpe901+xWyy0S67DB/Xb LmeaLw/mxq6wL00FXw4bImcNk4HLdJIHapQ+/9jVJKJ750TMVU2G0aXyqDxsr1daHNLs rOedousAxn+O6l8ccGqiviq2qKE4EHMln2Swo0yMwFzHeoyRIOOoVforwzuSnGMq6CPk bJSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=O+439ox2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d12si13630884ejj.33.2020.10.11.23.56.04; Sun, 11 Oct 2020 23:56:27 -0700 (PDT) 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=@google.com header.s=20161025 header.b=O+439ox2; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726497AbgJLGu3 (ORCPT + 99 others); Mon, 12 Oct 2020 02:50:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52434 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726123AbgJLGuY (ORCPT ); Mon, 12 Oct 2020 02:50:24 -0400 Received: from mail-ej1-x641.google.com (mail-ej1-x641.google.com [IPv6:2a00:1450:4864:20::641]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0E6A8C0613CE for ; Sun, 11 Oct 2020 23:50:24 -0700 (PDT) Received: by mail-ej1-x641.google.com with SMTP id qp15so21648780ejb.3 for ; Sun, 11 Oct 2020 23:50:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=vioP1tNDAwc//TCk7A/UlbXm8YsyMW81aBUSwcUWM5M=; b=O+439ox2/Jk704Wg3CCUuHHBA7dCtS4tZf+rbJq812ZTK0+aViDD/HY0/QxPd0NQUF ngHa2P6lniSz1x39IKz9kkJx3LLfC44s2/JJskJsdLcsascUYtB8fvFbW2NUKmgYpA5Q qL9WLDhxkbA2zZxRNrznWAIqkL2ei6gdtH+l382VbGUXGyDlZfX1JuQlmj8y4p6Pv7Ya PCb7RLzFG3YZKtxf36SIr0kXRSp+EPs53UzJcQpDQjjPS1FfrR29JMJjOQ8qQg6Vn8KF 8bEv0NFsREh+8yHvWjRy47WCNFi88C5LcrjZPuN4J2StRjzSrBdFLJaQj2bNrzV9tws4 /EJA== 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=vioP1tNDAwc//TCk7A/UlbXm8YsyMW81aBUSwcUWM5M=; b=Fh1QaXn+C+n8AvFawJ6OjIgkc7gqO3lZIrXxdedWBdHPUA9uTFUZmFi9386f6DuhsC 4RGC2Jtz5eghrVYUjT6No1cLUJE3BacGeIEg6ySm4eEwmdXOqeRfy/az49aMmipURbsg Y6HxVqpA3Xwd10c1OE2C7rAKEG3A9Q8Ho8Lwhh2RDcOXAzlYpBm2dd/kTQ7prDUuo6YZ xFHj/Ki4gw5gXuJQEAqjxcWvROjS3A9PVAJYtjDdd6KZUSkl3BE/bl7QehKPk+ZM+63H SwafW3baEHDRaYdRyuph3siFTkgAUaqB/6k/kSRUtRSJL0+U+YS51ZgNachmsK/IFrwi JEsQ== X-Gm-Message-State: AOAM530ByntwrVJRHJwMujE/UyhaJ5TphxM2N6xi91ypYrhH4I/iSTwW VSW2L2VtHT0cbK9OtuHDSm3TUdsN2SK8f/K7jF5euQ== X-Received: by 2002:a17:906:c0d1:: with SMTP id bn17mr15283227ejb.114.1602485422519; Sun, 11 Oct 2020 23:50:22 -0700 (PDT) MIME-Version: 1.0 References: <4706b0ff81f28b498c9012fd3517fe88319e7c42.1602431034.git.yifeifz2@illinois.edu> In-Reply-To: <4706b0ff81f28b498c9012fd3517fe88319e7c42.1602431034.git.yifeifz2@illinois.edu> From: Jann Horn Date: Mon, 12 Oct 2020 08:49:56 +0200 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 , kernel list , Aleksa Sarai , Andrea Arcangeli , Andy Lutomirski , David Laight , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , 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 Sun, Oct 11, 2020 at 5:48 PM YiFei Zhu wrote: > Currently the kernel does not provide an infrastructure to translate > architecture numbers to a human-readable name. Translating syscall > numbers to syscall names is possible through FTRACE_SYSCALL > infrastructure but it does not provide support for compat syscalls. > > This will create a file for each PID as /proc/pid/seccomp_cache. > The file will be empty when no seccomp filters are loaded, or be > in the format of: > > where ALLOW means the cache is guaranteed to allow the syscall, > and filter means the cache will pass the syscall to the BPF filter. > > For the docker default profile on x86_64 it looks like: > x86_64 0 ALLOW > x86_64 1 ALLOW > x86_64 2 ALLOW > x86_64 3 ALLOW > [...] > x86_64 132 ALLOW > x86_64 133 ALLOW > x86_64 134 FILTER > x86_64 135 FILTER > x86_64 136 FILTER > x86_64 137 ALLOW > x86_64 138 ALLOW > x86_64 139 FILTER > x86_64 140 ALLOW > x86_64 141 ALLOW > [...] > > This file is guarded by CONFIG_SECCOMP_CACHE_DEBUG with a default > of N because I think certain users of seccomp might not want the > application to know which syscalls are definitely usable. For > the same reason, it is also guarded by CAP_SYS_ADMIN. > > Suggested-by: Jann Horn > Link: https://lore.kernel.org/lkml/CAG48ez3Ofqp4crXGksLmZY6=fGrF_tWyUCg7PBkAetvbbOPeOA@mail.gmail.com/ > Signed-off-by: YiFei Zhu Reviewed-by: Jann Horn