Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2046414pxu; Tue, 24 Nov 2020 15:45:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsel0u93S1FLEpSqkVJJJEQeFJa21/THtJSVUhDrM6H9deHXbTQ65rpuKDZouH2AzUgg61 X-Received: by 2002:a05:6402:17d1:: with SMTP id s17mr971044edy.2.1606261557611; Tue, 24 Nov 2020 15:45:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606261557; cv=none; d=google.com; s=arc-20160816; b=ruqwSW6IzuD4qwB5XZZG2IbdJsl1XjrbKAbMI1VWyacgma94exKqrORogsrLTpXABg OBY9OG3OulXr2wWOBLt/mUq2wrwPxkIiYCTseIx2tZA/yzOCEy/Ed2I3Rclno8gTBxAs 48XKyJIyA+8Ge66xqQd34OiWAQ0HptFUuXPbWGouMrJvpqwjCHb7wDkMakwgN9ggls/m 4gx9HykXRC4hUOR9DdVPfgbFISCSigRUZv09jKIcRIxoXxHa8R18jNmonxuA4Csh9d4d i7CblrRvN+8xRbh6O5jAImtk24Zd/LqW2Fn+MDvYiEw5sNX2cRwVKUkD3Z3s5un3JHgV O27A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=AsqIMUmpdhlztFmlb356HAMbnbqfjuUF6mFhy/NX3d8=; b=SqM7mcC+csHewHzIVpRC6khCYGO46wEdzANuJSq4FY9MgDzU76Q9Oce5zthelBGRzL 1yPe1UuHDEh+oyy/zyGrR4P0ubip4i0SeSr1nYOT8dHaVyQEkzmGenKsTI2MtMLmAgWc 7IpuMFjetbmKUpJSUD/X2jRF60LxVsSMXQ4KUKRtOZt5WZntcur/NqagX6Iwk+UKIp9k G4YVt8dARrsvXGGSyaZW21EVgKiX8U1i5aL/VW9FHj0U+l8RiOmyOqyaevS6H3+jSxth zvIq5hKSiPZ903uTdArtbYdD7cn7JxgSUmpkW5MTcaFYiiaBX4dsO+etojSCASbfM8nx XALA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=gKz9tVfE; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id oi22si246705ejb.690.2020.11.24.15.45.34; Tue, 24 Nov 2020 15:45:57 -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=@linuxfoundation.org header.s=korg header.b=gKz9tVfE; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390547AbgKXRPl (ORCPT + 99 others); Tue, 24 Nov 2020 12:15:41 -0500 Received: from mail.kernel.org ([198.145.29.99]:49264 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390308AbgKXRPk (ORCPT ); Tue, 24 Nov 2020 12:15:40 -0500 Received: from localhost (82-217-20-185.cable.dynamic.v4.ziggo.nl [82.217.20.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 99F95206E5; Tue, 24 Nov 2020 17:15:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1606238139; bh=J0afl+2LLskLIWwsKBm6ugjEsGEPidJcN2s83PAH1r8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gKz9tVfElOsxRj4E39Sw9bNOpcDs0K6NqDUiZ26523s5kVYVtCbqgMrYBjJcJ9C8U g8wHYWoFUcp/3MnWIvapgjlc2xkmOghOIjzIiAVFRW0wiDAZt4oDVD9jglryLBR2e/ etGuqA4ACTpJq6tc8SL/y6I3eWS1GMMVNydlwpW8= Date: Tue, 24 Nov 2020 18:15:36 +0100 From: Greg KH To: Jann Horn Cc: Christoph Hellwig , Kees Cook , Andy Lutomirski , Will Drewry , Mark Wielaard , Florian Weimer , 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 Message-ID: References: <87lfer2c0b.fsf@oldenburg2.str.redhat.com> <20201124122639.x4zqtxwlpnvw7ycx@wittgenstein> <878saq3ofx.fsf@oldenburg2.str.redhat.com> <20201124164546.GA14094@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 24, 2020 at 06:06:38PM +0100, Jann Horn wrote: > +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... Why? seccomp is saying "this syscall is not permitted", so -EPERM seems like the correct error to provide here. It's not -ENOSYS as the syscall is present. As everyone knows, there are other ways to have -EPERM be returned from a syscall if you don't have the correct permissions to do something. Why is seccomp being singled out here? It's doing the correct thing. thanks, greg k-h