Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1842145pxu; Tue, 24 Nov 2020 10:08:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJzq1m2HZrX58nnqzLlAGLvcLoprODJNXrXEklkxMj00vrDcX0aepLY6kWFFNYcy8CqlQpxC X-Received: by 2002:a50:cfcf:: with SMTP id i15mr5110688edk.351.1606241296379; Tue, 24 Nov 2020 10:08:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606241296; cv=none; d=google.com; s=arc-20160816; b=JkW8VvGeoUFFSieDoSOGC63PRMUX2/6jBzgkCQtZsJcRaVnOJORueGGdomlktVgsoT cE5zZc6J+y8ZdvPwlurinUgA+i47W0hcBqMwGSddpT+Rpr1YmjIfCXYSe6aovKCcKCkv +bkIwbRGjwl5n+e4Nq5O2pUu6Yw8c8COQImpkTmlOAxx9jP+dYA/B6temOmc/etxSz/s QGt2BcclygfV0d98yJ6RvNsvLdpbB35mfv5A9Gxx20gIAzECRpqhVx2OCm2PKZVjuvoi nFsKIs8SXtq0RcezDeSjBeX60G8p6INYtv/2sqlW6fR4y98R0QrgQlXiJT4SlkyDAPkd 5EfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:message-id:in-reply-to :date:references:subject:cc:to:from:dkim-signature; bh=JQRdCyEjd8lB1hJnU6FBbehjJrMGCDIdPwywH5xUhec=; b=ZA7iQvJlP+mnWaNp42rORiTRKK4Om808r3EmjwKdW7bt4UiLDq9cXq6S92xzRr1+h/ 1acAePFVlZiMc+7VkrTwee5pyv+mTWAPSofqFBAUV7G6x7qbm1vA3Fcrm3M5fcVPwqNv gIZNqcin2ql3pJYBKhza6wPJ3tYrZ8MApGMBUZ+uKPqz4mMrhU5Jbg8CgIxfA4Qf260f xb1oeeOY58PGveJw4pLJxpAvMbI7qV/Gs7LXSsgde//R45SiDgf9viOUIBumsZ0+k8/f QYwKYbEg9pNnxDW8WFVgjdt/lbmMlXXyWSt1oysjr15gPq2vtys0WzCZaCKoGJNyj8NM 2ejw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=AoW4BsSb; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r15si6926264edx.70.2020.11.24.10.07.51; Tue, 24 Nov 2020 10:08:16 -0800 (PST) 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=@redhat.com header.s=mimecast20190719 header.b=AoW4BsSb; 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=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2404106AbgKXSDK (ORCPT + 99 others); Tue, 24 Nov 2020 13:03:10 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:36720 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728945AbgKXSDK (ORCPT ); Tue, 24 Nov 2020 13:03:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606240988; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=JQRdCyEjd8lB1hJnU6FBbehjJrMGCDIdPwywH5xUhec=; b=AoW4BsSbu2td1z/a5ktWMsBQ7A8+lMygYTuIldxX3RlS2YwvM1C0wcyC702yz7Tq6o74MS 38zrP4Py4LNyqjv8P1hP9qTQa3advLkheupWIagvgRIn2oA4s8Y6bnifUanZvzo+9B7nRh EoBeLEB14qoVx9t6EgrhMEL1IKBSTew= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-350-IEMlTEUgMoO_v_UEUqZUmA-1; Tue, 24 Nov 2020 13:03:03 -0500 X-MC-Unique: IEMlTEUgMoO_v_UEUqZUmA-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 5802A18C43C7; Tue, 24 Nov 2020 18:03:01 +0000 (UTC) Received: from oldenburg2.str.redhat.com (ovpn-112-141.ams2.redhat.com [10.36.112.141]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 770F75D6AB; Tue, 24 Nov 2020 18:02:55 +0000 (UTC) From: Florian Weimer To: Jann Horn Cc: Christoph Hellwig , Kees Cook , Andy Lutomirski , Will Drewry , Mark Wielaard , Christian Brauner , Linux API , "open list:DOCUMENTATION" , kernel list , dev@opencontainers.org, Jonathan Corbet , "Carlos O'Donell" Subject: Re: [PATCH] syscalls: Document OCI seccomp filter interactions & workaround References: <87lfer2c0b.fsf@oldenburg2.str.redhat.com> <20201124122639.x4zqtxwlpnvw7ycx@wittgenstein> <878saq3ofx.fsf@oldenburg2.str.redhat.com> <20201124164546.GA14094@infradead.org> Date: Tue, 24 Nov 2020 19:02:53 +0100 In-Reply-To: (Jann Horn's message of "Tue, 24 Nov 2020 18:06:38 +0100") Message-ID: <87pn42zl82.fsf@oldenburg2.str.redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jann Horn: > +seccomp maintainers/reviewers > [thread context is at > https://lore.kernel.org/linux-api/87lfer2c0b.fsf@oldenburg2.str.redhat.com/ > ] > > On Tue, Nov 24, 2020 at 5:49 PM Christoph Hellwig wrote: >> On Tue, Nov 24, 2020 at 03:08:05PM +0100, Mark Wielaard wrote: >> > For valgrind the issue is statx which we try to use before falling back >> > to stat64, fstatat or stat (depending on architecture, not all define >> > all of these). The problem with these fallbacks is that under some >> > containers (libseccomp versions) they might return EPERM instead of >> > ENOSYS. This causes really obscure errors that are really hard to >> > diagnose. >> >> So find a way to detect these completely broken container run times >> and refuse to run under them at all. After all they've decided to >> deliberately break the syscall ABI. (and yes, we gave the the rope >> to do that with seccomp :(). > > FWIW, if the consensus is that seccomp filters that return -EPERM by > default are categorically wrong, I think it should be fairly easy to > add a check to the seccomp core that detects whether the installed > filter returns EPERM for some fixed unused syscall number and, if so, > prints a warning to dmesg or something along those lines... But that's playing Core Wars, right? Someone will write a seccomp filter trying to game that kernel check. I don't really think it solves anything until there is consensus what a system call filter should do with system calls not on the permitted list. Thanks, Florian -- Red Hat GmbH, https://de.redhat.com/ , Registered seat: Grasbrunn, Commercial register: Amtsgericht Muenchen, HRB 153243, Managing Directors: Charles Cachera, Brian Klemm, Laurie Krebs, Michael O'Neill