Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1853700pxu; Tue, 24 Nov 2020 10:23:29 -0800 (PST) X-Google-Smtp-Source: ABdhPJy5sFgYoI5xyd8BbQ+GX0mQ5zDGWH3lE4ykk/nd3O6anMvXZ+WnvIiO7HUbaqdGiqsn61Gf X-Received: by 2002:a17:906:9252:: with SMTP id c18mr5179472ejx.489.1606242209231; Tue, 24 Nov 2020 10:23:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606242209; cv=none; d=google.com; s=arc-20160816; b=TXbzMZgNlkoEgfyRLJP9m7HaElYS6bC59ce4ObMGgRn4jdoIjAgQxVlHzu58CBh1fE bB9NKjLjrM/gThWMlgpuCb/Gk0qGPMaxdLesL21MmX5gyWcd7HTUWh/IjgUX6p++vhiC 0H+rTIeuyK4mF4KzzBLwodIj4Rdst9mMbzQrzl1+LuKGbynA6VLD4suyOPJF2kkd83yH 3fX86p35mv4LG3VgFSMlfhm2XA5oaHKes7j0X+5l1Rzu+DmO/ehyMUhfO4vGhd4MlJeV PHXZLBXgI9kGJwMHIbktixX43pjnRGQT3qSFeRrcgazuelRsNb7eOcKLdgBOLPz9IFag 7gEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:subject:cc:to :from:dkim-signature; bh=LUJObGYPcxmWCt1F5rpzYy+8ynXVUFmmSX89XWvIPx0=; b=ET/QToNV0R5KZVphuEPMkOdxi96ffYIm9Mmrq5vEx+PnQ2sZdGPoj1sqnfLcj8b+KO 2KYsp61nPffeuacQ/63rU/atNMxTc32Onap6Sv9vzYDgTbKzCrl+ZNd7GTWqkR2Cs/tw LgrZMDMCLxCIcQg0JqARQUEeToj4JjGTCr3ODMSPeecwSoaSm+b+YV3vge9LVJaHdWXi WpyLd37MOIXqDx4X74AcWyxbUfqRvvC+PT02OSNxvHGPAus1GuB8vSpjwYrFMIJ/15f+ UDt6QL6XCzcX9e+NMnnaDhoRWdmS3AyIiBp7+8LhxkEzUfIHSapunP8lbrpZK2S8NOJM oG/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=IBs+2YGD; 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 dk11si7151108ejb.542.2020.11.24.10.23.05; Tue, 24 Nov 2020 10:23:29 -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=IBs+2YGD; 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 S2387957AbgKXSRe (ORCPT + 99 others); Tue, 24 Nov 2020 13:17:34 -0500 Received: from us-smtp-delivery-124.mimecast.com ([63.128.21.124]:31282 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404163AbgKXSRO (ORCPT ); Tue, 24 Nov 2020 13:17:14 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1606241833; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=LUJObGYPcxmWCt1F5rpzYy+8ynXVUFmmSX89XWvIPx0=; b=IBs+2YGDR2hhvilYBLNrT23SHZ6eA45UCPVf5n2IsVVEPSI00bmNbwlSZXXrqE2SIhVO0w axjZz04a1/WI1KnHSSMTnVkwDpDaJnT+MgfYzxqzpLT1AEwiCy25X0x65XzQe/NWFOnzPg 7PFPLet8FUO4d9Z8DRdw4hCRYw3W9Ig= 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-332-kFERPdGdOIaj_Nega45EAA-1; Tue, 24 Nov 2020 13:17:11 -0500 X-MC-Unique: kFERPdGdOIaj_Nega45EAA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id E83A180364D; Tue, 24 Nov 2020 18:17:08 +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 1F81760BE5; Tue, 24 Nov 2020 18:17:02 +0000 (UTC) From: Florian Weimer To: Jann Horn Cc: Greg KH , 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:17:00 +0100 In-Reply-To: (Jann Horn's message of "Tue, 24 Nov 2020 18:30:28 +0100") Message-ID: <87h7pezkkj.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; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Jann Horn: > But if you can't tell whether the more modern syscall failed because > of a seccomp filter, you may be forced to retry with an older syscall > even on systems where the new syscall works fine, and such a fallback > may reduce security or reliability if you're trying to use some flags > that only the new syscall provides for security, or something like > that. (As a contrived example, imagine being forced to retry any > tgkill() that fails with EPERM as a tkill() just in case you're > running under a seccomp filter.) We have exactly this situation with faccessat2 and faccessat today. EPERM could mean a reject from a LSM, and we really don't want to do our broken fallback in this case because it will mask the EPERM error from the LSM (and the sole purpose of faccessat2 is to get that error). This is why I was so eager to start using faccessat2 in glibc, and we are now encountering breakage with container runtimes. Applications call faccessat (with a non-zero flags argument) today, and they now get routed to the faccessat2 entry point, without needing recompilation or anything like that. We have the same problem for any new system call, but it's different this time because it affects 64-bit hosts *and* existing applications. And as I explained earlier, I want to take this opportunity to get consensus how to solve this properly, so that we are ready for a new system call where incorrect fallback would definitely reintroduce a security issue. Whether it's that ugly probing sequence, a change to the OCI specification that gets deployed in a reasonable time frame, or something else that I haven't thought of=E2=80=94I do not have a very strong preference, although I lean towards the spec change myself. But I do feel that we shouldn't throw in a distro-specific patch to paper over the current faccessat2 issue and forget about it. Thanks, Florian --=20 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'N= eill