Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1384324rbb; Mon, 26 Feb 2024 07:40:52 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXqZcDntPBpGpeHB2egQo4H1NC0BVvUduDRr1zrCDPLL8H5c07JKHPrA/iTgW5TUHGcVBK+Ck96BhgI96jFxUHfDH5gzrZ5nzC5AkbR4A== X-Google-Smtp-Source: AGHT+IGSP553UmyZwID3c2EX/7dEqbn4YKeWge0F7lF1lT4TQJTO8Auwu+e0Q/JFAc8V/U0EmDjq X-Received: by 2002:a67:fe58:0:b0:470:5282:7dd7 with SMTP id m24-20020a67fe58000000b0047052827dd7mr4661277vsr.18.1708962052125; Mon, 26 Feb 2024 07:40:52 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708962052; cv=pass; d=google.com; s=arc-20160816; b=Otlm4yCaafi50DiSdTtfSUBsuim+2qu05rR6XeZVGTpe/jNjL37TDIV8xg7pChSde7 Ogm+RHWLV8ajaMed+KtcHmQiMFU/qtCiIOhcTTK783JQJ8NjwIPkLc4qX747BTDmn/WF +b85YbXOT2BG8cmwxwDW2a3PTtgmI8Gv107dT26sFMi55g75D+OXBAI5gG5IvmIhkwxw RZbcM1u8Qbuy3hV4RwgkS/xDUCJFVu+NWKCjGVj5VSLF14Fr68OLhGqgVygueyprx5mK SFpSBZfpkedz5cHe+JO276t8kZuuBtLu84sVAknGuzSsuscnvxifcMbeDgJM+dX1j9cc c5kw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=4qNK6+Bm5rwYQM0ebrDB94iIO95HoIpkGQ8UTxTwffQ=; fh=mKBw+FLXbaI617OPjbIlmefsswcFZ2mJo8wZVfzqKJ4=; b=j6qhMtx6r5RLeqfc85zYfCKnP0NK3dN+PNw3HAYt/elu1SOKvffAW/UkevINUJ+3Vu n4vQCVwPao8eKwFVvdQ5xUag1q96A27nNR/GCgH7nBMWuxc5UzVUjtRClh7HeqyJZN0+ 3Gqof0yTdxj/6LyQH8qs8MZiSE4tFPlwU5PwZViL1NRI1q3IEylMchEClaNt3mg0AoTT ocJHZXXyTugXlF5x+jqYzPHE0hfzjMVYQSBjjqYI4o4n5oUwvMJT2STQIeHJzBYH6IwZ 4zt4oYD8pl4L2/YHjB49XXda8q1VRqFdTPhYuYS+6FvvYYfq1kCvF7uWflVbGnGb8ZMX kAwQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pDxVS0q8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id j17-20020a056102335100b004703f01cbd2si652170vse.161.2024.02.26.07.40.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 07:40:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-81821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pDxVS0q8; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-81821-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-81821-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 555A01C268DE for ; Mon, 26 Feb 2024 15:40:41 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ED1B912BE9F; Mon, 26 Feb 2024 15:40:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pDxVS0q8" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 874D212BEAF; Mon, 26 Feb 2024 15:40:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708962032; cv=none; b=n/wr0d2PaDruVpVlnqpNnZDK63R2c+y1YtfMI7GCjpEbxj5uNR2JFAEE4bimPzyMIR39r9TNu7DhCdylPzvEFKv2GKqH+DMmDeCg3erPmiwPHNd2PlARirh7T5BocvOGHHnsA+GH0qx97BDTzlxt3vT1Ed8+dwb4YZdYyzpCBbs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708962032; c=relaxed/simple; bh=LqdZVF/5a5y9c7R0XJh34mAsJKHFvghTFVi0Kr3+2NY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nwC30FoeTXpKO/dNmwnO9GJXrNSRMXrZmgKg5AQFX/95eUR5VX2+WuDrRFU5OvLCLo7scsCVKbYanCm7Vo3IcpmhFL7qX2sTUAr0dT/t56SSBHZU0LN+NI3Ic4sd6jQNH3uVqMBjziUVb3/8SZEFRVhHhhrqNuGEv2KUFW+WdaE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pDxVS0q8; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 38C92C433C7; Mon, 26 Feb 2024 15:40:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708962032; bh=LqdZVF/5a5y9c7R0XJh34mAsJKHFvghTFVi0Kr3+2NY=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pDxVS0q8Z3vpInLZ2QGBmd3bVTIaQVmD0Lg1FYweLvPwIbiCpQkMP7ZsWJjB8XGxz gzfyUh1+Ri7hI47ZLD0r2BbaP4NKvMOkYaCvn8A6uukIq4ZRgoAEGku8/mMxhNqzkA yvH2C6zhpPfy58dvkw+7jlsSzx5UfhYSmHsA0+tq1nwW+D9zb3A5R/sPl88jfUmX1O C2bPKjjaN4znMiobBOe3M/Kr19GSPeS6tZECdBbtUYH87T3HRdbua3LgIychQrhL6L E4SFQz52hUoq8sS6Y1U0lSrRsoxaUm8Lk/mld0Yd6oJw3qUFfKO2RjYMYTv722TFJQ aki7mnG1lzw/g== Date: Mon, 26 Feb 2024 16:40:25 +0100 From: Christian Brauner To: Arnd Bergmann Cc: Xi Ruoyao , Icenowy Zheng , Huacai Chen , WANG Xuerui , linux-api@vger.kernel.org, Kees Cook , Xuefeng Li , Jianmin Lv , Xiaotian Wu , WANG Rui , Miao Wang , "loongarch@lists.linux.dev" , Linux-Arch , Linux Kernel Mailing List Subject: Re: Chromium sandbox on LoongArch and statx -- seccomp deep argument inspection again? Message-ID: <20240226-sandbank-bewerben-219120323e29@brauner> References: <599df4a3-47a4-49be-9c81-8e21ea1f988a@xen0n.name> <24c47463f9b469bdc03e415d953d1ca926d83680.camel@xry111.site> <61c5b883762ba4f7fc5a89f539dcd6c8b13d8622.camel@icenowy.me> <3c396b7c-adec-4762-9584-5824f310bf7b@app.fastmail.com> <6f7a8e320f3c2bd5e9b704bb8d1f311714cd8644.camel@xry111.site> <20240226-graustufen-hinsehen-6c578a744806@brauner> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Mon, Feb 26, 2024 at 02:46:49PM +0100, Arnd Bergmann wrote: > On Mon, Feb 26, 2024, at 14:32, Christian Brauner wrote: > > On Mon, Feb 26, 2024 at 10:20:23AM +0100, Arnd Bergmann wrote: > >> On Mon, Feb 26, 2024, at 08:09, Xi Ruoyao wrote: > > > > What this tells me without knowing the exact reason is that they thought > > "Oh, if we just return ENOSYS then the workload or glibc will just > > always be able to fallback to fstat() or fstatat()". Which ultimately is > > the exact same thing that containers often assume. > > > > So really, just skipping on various system calls isn't going to work. > > You can't just implement new system calls and forget about the rest > > unless you know exactly what workloads your architecure will run on. > > > > Please implement fstat() or fstatat() and stop inventing hacks for > > statx() to make weird sandboxing rules work, please. > > Do you mean we should add fstat64_time64() for all architectures > then? Would use use the same structure layout as statx for this, > the 64-bit version of the 'struct stat' layout from > include/uapi/asm-generic/stat.h, or something new that solves > the same problems? > > I definitely don't want to see a new time32 API added to > mips64 and the 32-bit architectures, so the existing stat64 > interface won't work as a statx replacement. I don't specifically care but the same way you don't want to see newer time32 apis added to architectures I don't want to have hacks in our system calls that aren't even a clear solution to the problem outlined in this thread. Short of adding fstatx() the problem isn't solved by a new flag to statx() as explained in my other mails. But I'm probably missing something here because I find this notion of "design system calls for seccomp and the Chromium sandbox" to be an absurd notion and it makes me a bit impatient. And fwiw, once mseal() lands seccomp should be a lot easier to get deep argument inspection.