Received: by 2002:ab2:6a05:0:b0:1f8:1780:a4ed with SMTP id w5csp1102422lqo; Sat, 11 May 2024 07:28:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUQAuiF9ACCVjSVDh4XJ6xPPbb4fbo0C3yapi+KlBUxjfVFO5gmP0YdKj9olEAv8tvFBY2ZJepYaqfqAmurXR22MQxzwMWrznAzhC0c2A== X-Google-Smtp-Source: AGHT+IGOaLRVFI6GP/zX28sr344JYwO8sXMSUspawAKYGrZU3NE/AFzLAYk9BtJdTY+Qbg1FrPrZ X-Received: by 2002:a25:dbd2:0:b0:de6:1be9:13a5 with SMTP id 3f1490d57ef6-dee4f4da22fmr5346274276.45.1715437738319; Sat, 11 May 2024 07:28:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715437738; cv=pass; d=google.com; s=arc-20160816; b=wR9i7j7zZR3S5+kR8lvc+DAKmXYxxCRcucoFLXroFkfFpzuzbUC8+s+3wy3tk+09nS 9Op6bH+pq08MOvrorfPLituC6K73Z5J3bLL4jNi94kVosekunwGI+/AfafVxeJnpCQGG +/DZv6cMFiDlCXKXrd9ytIEC3ia6dwpYWWLDW8seqlhS9vRmxPiV8TImKY/oYBgrN5Qk GZ+PIUpzQ8Qcq29+K2UjqsIVFcPDZtJw/MbreKzGrYXEhHZq6KDVH2bYAHyXtYiu+uvG Iipheyf/1ELCJUGEOi9qhwvsYECRX4EVsZQ1HNjOcOrXjFYVGy1Nl4Rv+U3T8JWjPyk2 l1GA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Q86RayvY3EJvKcJx04lsPUbRaImuC0OGL6nywI5kyU0=; fh=5WG6EpB78EyGA4IPh10lwmeZKlN8zxcQl5CcGX6lyxc=; b=W25sb41HG0o5gtGbvdgjqOIAvYQK6EMOXBkmCsohS4DcLbg/8zvQ5VxROQ/ZN7stg/ SoPj+RJPbJQZyb1rTQvDrKil1kWeKop8h8HtXGC0/h0fQcOOWAIZx+hefP+xMMZvDLDl kqQ+12hFmeA1foMaMm73rtDknQWLIjLq7ON+dmu8Ytcvf3hQeFjYjOPMOicIbcHJwY2A EgR2O5c33+P4ltl7X9ZXKtIu4Em3j3LdpVE0oBV0JdX/SKvAgAnFbYKfAarEc42p+mEf OIYW2lITRx6BaDZaPP+xAje6wLVVHCVBY18GmNq+1aLeWTWPaIlDz5weDbuPJNuD7XML 1zqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=nnu+PfEJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176576-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 af79cd13be357-792d7c92ac6si34247385a.720.2024.05.11.07.28.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 May 2024 07:28:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-176576-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=nnu+PfEJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-176576-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-176576-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 E22841C20B4E for ; Sat, 11 May 2024 14:28:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A461053E37; Sat, 11 May 2024 14:28:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="nnu+PfEJ" 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 B68686FC6; Sat, 11 May 2024 14:28:48 +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=1715437728; cv=none; b=qZO2hJaz+b5oRFL7/0lMHEbz5Kny+afMc9RRQLRLfDyN6ET5Wn4TjwK9iClW+Cv1JCys87x05pzGUU9T2IEf5L1ewK3DuGjT/SU5kpYce2zPbsc2FdMBU66YcP5MbOlBusX6D9qwmOGIaoMjG97kLOgB4vKVrBgw7yEgXhWu/fk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715437728; c=relaxed/simple; bh=hVfcUB6YKy1TPaPObfF0ZH0LYE3QeixYLkT+X70y2W8=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=XOL1Fb1MXA0fCTzLRCiS4J7Oc4dGiOjxn/GmpjGwSiyuNY6vV8/El1JnC3FL29XFSWhHllrMTYxWeAI9FhjNAaQSrmkKnut+vrAHG9CioQS3xRcofebtpM3N8gCBahhfIUtOvSlckBo7G1Offyv1EhASb7OPc/W2lJ1wQTlczZk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=nnu+PfEJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4AB00C2BBFC; Sat, 11 May 2024 14:28:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1715437728; bh=hVfcUB6YKy1TPaPObfF0ZH0LYE3QeixYLkT+X70y2W8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=nnu+PfEJGjGmGgBroc5jGVFnyvQpbNL2PUvAjMk38AWUWnIaN1HGd+UJ0eMgNDNSc P2psasTiG4tcFU6QstXSouDzgyTesp7HArJCxBbMtZzNfYDO/S+XN376hKfRncU5o4 dIHPSiZV5TdcZ4+pnLZNbikd4463oZ/R5rhgBQxdwbMGUW8aNUYjettwu3AwF+0RhR LJx+1Lqtj5vr9j74vpu75PsGPbBErDCNNImXB05ejRU5lGI0prmRrt/zclERizUkqj 2fthMVQhKlDev4TPCt+8/2MWChc4Q//y2ImJQH/4WpiizTxniHKO9YX3sM6KdDxwmW B0EcJaYNqWDDQ== Received: by mail-ej1-f42.google.com with SMTP id a640c23a62f3a-a59a387fbc9so767600066b.1; Sat, 11 May 2024 07:28:48 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUmMmbUQCL2nYjHNB54mUQQXQ5/+Nrf8Kt/XAMzttmo9CycKuliP8eDL0Re5qjpWj48NQzqC70QLoRI5itlrVb+KeefBNUsluu9TJ/ErdF15L1yLYv9CwToYaYtMXy5U21SNVg7oUF1+adH3+MCf5PWPBkDT0Em/l/VePIfmSgpCw== X-Gm-Message-State: AOJu0YxSjy43d++nIAO8rFctShXaksuLnI+jY+7iTixLalWdRHUDFzD5 +4giTvv6Ar7JYvjOZYaGeSXtMb9tdGLR8pEjnoJ46W50InczuVXj71n+BLDzdRDQAjqPI9uwdp3 7apVzbq1OzEbldUTYAHl7l9A/vSk= X-Received: by 2002:a17:906:1c10:b0:a59:9b75:b84 with SMTP id a640c23a62f3a-a5a2d5d4492mr330834966b.35.1715437726856; Sat, 11 May 2024 07:28:46 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240511100157.2334539-1-chenhuacai@loongson.cn> In-Reply-To: From: Huacai Chen Date: Sat, 11 May 2024 22:28:37 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h To: Arnd Bergmann Cc: Huacai Chen , loongarch@lists.linux.dev, Linux-Arch , Xuefeng Li , guoren , WANG Xuerui , Jiaxun Yang , linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn, stable@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, Arnd, On Sat, May 11, 2024 at 8:17=E2=80=AFPM Arnd Bergmann wrote= : > > On Sat, May 11, 2024, at 12:01, Huacai Chen wrote: > > Chromium sandbox apparently wants to deny statx [1] so it could properl= y > > inspect arguments after the sandboxed process later falls back to fstat= . > > Because there's currently not a "fd-only" version of statx, so that the > > sandbox has no way to ensure the path argument is empty without being > > able to peek into the sandboxed process's memory. For architectures abl= e > > to do newfstatat though, glibc falls back to newfstatat after getting > > -ENOSYS for statx, then the respective SIGSYS handler [2] takes care of > > inspecting the path argument, transforming allowed newfstatat's into > > fstat instead which is allowed and has the same type of return value. > > > > But, as LoongArch is the first architecture to not have fstat nor > > newfstatat, the LoongArch glibc does not attempt falling back at all > > when it gets -ENOSYS for statx -- and you see the problem there! > > My main objection here is that this is inconsistent with 32-bit > architectures: we normally have newfstatat() on 64-bit > architectures but fstatat64() on 32-bit ones. While loongarch64 > is the first 64-bit one that is missing newfstatat(), we have > riscv32 already without fstatat64(). Then how to move forward? Xuerui said that he wants to improve seccomp, but a long time has already passed. And I think we should solve this problem before Debian loong64 ports become usable. > > Importantly, we can't just add fstatat64() on riscv32 because > there is no time64 version for it other than statx(), and I don't > want the architectures to diverge more than necessary. > I would not mind adding a variant of statx() that works for > both riscv32 and loongarch64 though, if it gets added to all > architectures. As far as I know, Ren Guo is trying to implement riscv64 kernel + riscv32 userspace, so I think riscv32 kernel won't be widely used? Huacai > > Arnd >