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=-11.4 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL 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 7CCD3C4727D for ; Tue, 22 Sep 2020 00:26:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1E8A523A7A for ; Tue, 22 Sep 2020 00:26:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="k/z93i6O" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729198AbgIVA0O (ORCPT ); Mon, 21 Sep 2020 20:26:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728000AbgIVA0O (ORCPT ); Mon, 21 Sep 2020 20:26:14 -0400 Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B6EBC061755 for ; Mon, 21 Sep 2020 17:26:14 -0700 (PDT) Received: by mail-ed1-x543.google.com with SMTP id e22so14552888edq.6 for ; Mon, 21 Sep 2020 17:26:14 -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=G7Ck98WMie8De6O0pTDamAVkzQynN+XYnigX3qz8tH0=; b=k/z93i6OyQSEoXepask26HHwQk3IBf+bJK74Jop2UZRbnG76zfY4uGo4LrMenkM0zm vuXXzpu248e8WXJjF+yIbRf1oQSTDH/vH+HbRMObPEnr3axoMbxhiB3SAJgULvCCz79M uNljKMUaSbJyXYEa16ZHOYWCpO2wjYahMiL6kgPZqGlfMEGyMHCn1fyT9gqVquT2YY12 BH5YyBtacnsqwewtapzcJe7jIZiqSkh3jfZWeeRpaGWM08VK1l+8loXjp+N671wTOw2N kMIsG4Ab98xHV23Gs1TY1e6EiYdOk4NEHCohbJKjOK2vT5lzDigPQznFKsKNjT39jRiy Z7VA== 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=G7Ck98WMie8De6O0pTDamAVkzQynN+XYnigX3qz8tH0=; b=EflV9rG0OBV/FnkNSoMes8DXXimh4oQxelzD8m7WdPGy+fpV86Czi3+r+lpyiKjhOX mDXov3KxBuUua/q3jxRiBzEgdHKX5WDOJBb6cdyqIZP06GFMgj+yy9kwgVB2xCM0PBgI O02ifOD8Ln4U57uAl2FzN/b/OzdpQQiczZj5nekJia4R/UfdPtkaMYrh1ZMcHDgLRFvN c/fAEkYtQitxTuFgfzhgcEJa1q/kVPeSASzgQ7q0dxJAOlxkq0bBbGoRUkailqLCfHLa /Qpnn/TOlgDZFQHik96UHYUr7XeTveWGm0S8YPNjUx1D4UOCIyPIslI/9LbX2toeMVWA VuDw== X-Gm-Message-State: AOAM530szQ8o8+/a3RN8XhLolI7hcYlsafsgp8Y5b5XsVv6xGpla22Zl srvkV9LkZGgB+eALnCl1/xOKWcdaS4s87ff/DU4Ulg== X-Google-Smtp-Source: ABdhPJyFQ1Gq/sHgfmYT/vq4s/qP10k5TYYWZoaOsilWoxhPoBnktNQHuIjFbeqYafUSymIhlYjKGFwLYz/eJFOUEeY= X-Received: by 2002:a50:fe98:: with SMTP id d24mr1408695edt.223.1600734372652; Mon, 21 Sep 2020 17:26:12 -0700 (PDT) MIME-Version: 1.0 References: <6af89348c08a4820039e614a090d35aa1583acff.1600661419.git.yifeifz2@illinois.edu> In-Reply-To: From: Jann Horn Date: Tue, 22 Sep 2020 02:25:46 +0200 Message-ID: Subject: Re: [RFC PATCH seccomp 1/2] seccomp/cache: Add "emulator" to check if filter is arg-dependent To: YiFei Zhu , Kees Cook Cc: Linux Containers , YiFei Zhu , bpf , Andrea Arcangeli , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jack Chen , Josep Torrellas , Tianyin Xu , Tobin Feldman-Fitzthum , Valentin Rothberg , Andy Lutomirski , Will Drewry , Aleksa Sarai , kernel list Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2020 at 1:44 AM YiFei Zhu wrote: > On Mon, Sep 21, 2020 at 12:47 PM Jann Horn wrote: > > > + depends on SECCOMP > > > + depends on SECCOMP_FILTER > > > > SECCOMP_FILTER already depends on SECCOMP, so the "depends on SECCOMP" > > line is unnecessary. > > The reason that this is here is because of the looks in menuconfig. > SECCOMP is the direct previous entry, so if this depends on SECCOMP > then the config would be indented. Is this looks not worth keeping or > is there some better way to do this? Ah, I didn't realize this. > > > + help > > > + Seccomp filters can potentially incur large overhead for each > > > + system call. This can alleviate some of the overhead. > > > + > > > + If in doubt, select 'none'. > > > > This should not be in arch/x86. Other architectures, such as arm64, > > should also be able to use this without extra work. > > In the initial RFC patch I only added to x86. I could add it to any > arch that has seccomp filters. Though, I'm wondering, why is SECCOMP > in the arch-specific Kconfigs? Ugh, yeah, the existing code is already bad... as far as I can tell, SECCOMP shouldn't be there, and instead the arch-specific Kconfig should define something like HAVE_ARCH_SECCOMP and then arch/Kconfig would define SECCOMP and let it depend on HAVE_ARCH_SECCOMP. It's really gross how the SECCOMP config description has been copypasted into a dozen different Kconfig files; and looking around a bit, you can actually see that e.g. s390 has an utterly outdated help text which still claims that seccomp is controlled via the ancient "/proc//seccomp". I guess this very nicely illustrates why putting such options into arch-specific Kconfig is a bad idea. :P