Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 36C1D72 for ; Tue, 1 Jun 2021 19:55:12 +0000 (UTC) Received: by mail-pf1-f181.google.com with SMTP id k15so344590pfp.6 for ; Tue, 01 Jun 2021 12:55:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ApMBV5fRu56qu4SK6yHlizJ6W1eRv0wSD3z+NP9p+0U=; b=N5hDZSfq/UlXfJ8hJLChOlY7XWu+QxfPXzk5Md44NJjRpsBwF8bGJFVpPeig2SNQcV QPaQUIQ5glLKlIY7qr2qPfE2TxakmhIXNEsbID6ecUP4bMFzZIZWgPBOvCaCJ+/oSUGn lNPLusLe+lAlv+nEN9XaEwzAbSutg+ee8Igc8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ApMBV5fRu56qu4SK6yHlizJ6W1eRv0wSD3z+NP9p+0U=; b=kMl0sgd688n5wtMcGHMQ+RXxwrIat8qgnfqmUZuCqsNfSdKoqmxMRFg3Qy45F7GPmq m383agXF1uK8Y/q0TgXncbw2softtO4myrKR19BbgAgVP2rIMh0nJFEcaQuSzjVDzcqx TpxTKslRkXmT5nqLeVNlhotw8AIs6Bmnscs4k6ZHTRbAP2olaup4PGyCS00HiJPk5BHT zz3Ref6NlulEzPKPi3YcugOtYFzRk1gW7o1BeEvsSAII2uZuvWhPSJJ7VK2xDQjZEOtm cLHhialM4A/iOHSKExjLFAB9Nq7UBw2dJbZnLG61LxOq4rsmw60hlRiRN9L1Ayf7whj4 qtnA== X-Gm-Message-State: AOAM532TjNWFnLW04vatjefFmdAk+QDcoGx9AMg+1keoXm/9ziaxFD9x IR6s6pmSDrm6dWT+Mf3CQxf4VQ== X-Google-Smtp-Source: ABdhPJy80Hs3KzZN3hBYzAEXNt+CQstTWbNv7MoTTvMu1cm6s5ZsF1KQjsVPyifZ3wlORwX61iM4Kw== X-Received: by 2002:aa7:8551:0:b029:2e9:f46e:c560 with SMTP id y17-20020aa785510000b02902e9f46ec560mr5993875pfn.14.1622577311708; Tue, 01 Jun 2021 12:55:11 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a129sm9613791pfa.118.2021.06.01.12.55.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Jun 2021 12:55:11 -0700 (PDT) Date: Tue, 1 Jun 2021 12:55:10 -0700 From: Kees Cook To: Christian Brauner Cc: Tianyin Xu , Tycho Andersen , Andy Lutomirski , YiFei Zhu , "containers@lists.linux.dev" , bpf , "Zhu, YiFei" , LSM List , Alexei Starovoitov , Andrea Arcangeli , "Kuo, Hsuan-Chi" , Claudio Canella , Daniel Borkmann , Daniel Gruss , Dimitrios Skarlatos , Giuseppe Scrivano , Hubertus Franke , Jann Horn , "Jia, Jinghao" , "Torrellas, Josep" , Sargun Dhillon , Tobin Feldman-Fitzthum , Tom Hromatka , Will Drewry Subject: Re: [RFC PATCH bpf-next seccomp 00/12] eBPF seccomp filters Message-ID: <202106011244.76762C210@keescook> References: <108b4b9c2daa4123805d2b92cf51374b@DM5PR11MB1692.namprd11.prod.outlook.com> <20210520085613.gvshk4jffmzggvsm@wittgenstein> X-Mailing-List: containers@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210520085613.gvshk4jffmzggvsm@wittgenstein> On Thu, May 20, 2021 at 10:56:13AM +0200, Christian Brauner wrote: > On Thu, May 20, 2021 at 03:16:10AM -0500, Tianyin Xu wrote: > > On Mon, May 17, 2021 at 10:40 AM Tycho Andersen wrote: > > > > > > On Sun, May 16, 2021 at 03:38:00AM -0500, Tianyin Xu wrote: > > > > On Sat, May 15, 2021 at 10:49 AM Andy Lutomirski wrote: > > > > > > > > > > On 5/10/21 10:21 PM, YiFei Zhu wrote: > > > > > > On Mon, May 10, 2021 at 12:47 PM Andy Lutomirski wrote: > > > > > >> On Mon, May 10, 2021 at 10:22 AM YiFei Zhu wrote: > > > > > >>> > > > > > >>> From: YiFei Zhu > > > > > >>> > > > > > >>> Based on: https://urldefense.com/v3/__https://lists.linux-foundation.org/pipermail/containers/2018-February/038571.html__;!!DZ3fjg!thbAoRgmCeWjlv0qPDndNZW1j6Y2Kl_huVyUffr4wVbISf-aUiULaWHwkKJrNJyo$ > > > > > >>> > > > > > >>> This patchset enables seccomp filters to be written in eBPF. Before I dive in, I do want to say that this is very interesting work. Thanks for working on it, even if we're all so grumpy about accepting it. :) > > > > > >>> Supporting eBPF filters has been proposed a few times in the past. > > > > > >>> The main concerns were (1) use cases and (2) security. We have > > > > > >>> identified many use cases that can benefit from advanced eBPF > > > > > >>> filters, such as: > > > > > >> > > > > > >> I haven't reviewed this carefully, but I think we need to distinguish > > > > > >> a few things: > > > > > >> > > > > > >> 1. Using the eBPF *language*. Likely everyone is aware, but I'll point out for anyone new reading this thread: seccomp uses eBPF under the hood: all the cBPF is transformed to eBPF at filter attach time. But yes, I get the point: using the _entire_ eBPF language. Though I'd remind folks that seccomp doesn't even use the entire cBPF language... > [...] but Andy's point stands that this brings a slew of issues on > the table that need clear answers. Bringing stateful ebpf features into > seccomp is a pretty big step and especially around the > privilege/security model it looks pretty handwavy right now. This is the blocker as far as I'm concerned: there is no story for unprivileged eBPF. And even IF there was a story there, I find the rate of security-related flaws in eBPF to be way too high for a sandboxing primitive to depend on. There have been around a dozen a year for the last 4 years: $ git log --oneline --no-merges --pretty=format:'%as %h %s' \ -i -E \ --all-match --grep '^Fixes:' --grep \ '(over|under)flow|\bleak|escalat|expos(e[ds]?|ure)\b|use[- ]?after[- ]?free' \ -- kernel/bpf/ | cut -d- -f1 | sort | uniq -c 4 2015 4 2016 13 2017 16 2018 18 2019 12 2020 6 2021 I just can't bring myself to accept that level of risk for seccomp. (And yes, this might be mitigated by blocking the bpf() syscall within a filter, but then eBPF seccomp would become kind of useless inside a container launcher, etc etc.) -Kees -- Kees Cook