Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp3583221pxk; Mon, 21 Sep 2020 18:46:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzITMS7At0RYXelUdLEyoO5Fho/fE0LUmBXXzaapEre3LNffeE0csR7iY9sYxlt9DpNWZTw X-Received: by 2002:a17:906:4088:: with SMTP id u8mr2503676ejj.184.1600739187408; Mon, 21 Sep 2020 18:46:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600739187; cv=none; d=google.com; s=arc-20160816; b=QNkQ4RGmziwSbx0BBO9QQKuoFWtlJLVrABYQcqKQyqXpqqzhOMFVp6miXQCnub9CjY o7QPUiNXrq/Z1ZYyY75V0bqJVucV7i7lBeq4u1oTJuN1mBvvVpK89ZP7n8oIvaL+/CCG eECJyj5ucj9W6DS2CQa9MGbxqy5P2NHINKGthyUYr6BpVfPunxA1J+hhaK0TXBudJEon FrW8qTchx9cNZlNOzcWRe0NI9LjG6Vy+FEbSGxsw0+jBaEdrFWKuS5XUXo1oKatZoRLN hkHGcZ0ZiS3EM7kNZP3ZXcPErePshHxdalrMa0XNH6TZeL7BWOIpjaBVJs7m/n36gbiL TF3A== 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=G7Ck98WMie8De6O0pTDamAVkzQynN+XYnigX3qz8tH0=; b=ByHpLMCxijAkEPO2N5jJLZuFN+KKrlk1F+fv8y8Vk4vOWDnCOsTUEN/4gwmPzRpz/I VdWbH5EDGs9WvNePanTcP7wcG3Kb8BxakXrbCikmHoAsG9yN/M30NA0dFzXoSnP2tfPb zapvp9OlWmzzPoXl1Grnu1e1T54Q+XlAA5UItbX/nXHWoinhv9mQqsQKDaZC5MkhwCeF 6MIjfGS91KCa871c4nrf9VBe0sjqCficgP+Tu5yAThjMuq+I4j3MVhT3oFqux4pVTAVe 0cdrL82dgRIrv6P2sbTo5nrZV3SlxV+Iy6p12bHqyIMTJHGXjbdT6vlEdlJuu9e3eGoV f4yA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="k/z93i6O"; 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 u16si10643167eje.727.2020.09.21.18.46.04; Mon, 21 Sep 2020 18:46: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="k/z93i6O"; 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 S1728725AbgIVA0O (ORCPT + 99 others); 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-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