Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp1344338lqs; Sat, 15 Jun 2024 05:12:59 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkZBskG6dPXUMcVtY7yMvbzYJIrVj4zHNM1WeH1tDf/qCIheTPX7YjsG7PBp+62YeJf+Rl9YLtrN+psRFNB1oxmTbqSItoVXJOrPkI+A== X-Google-Smtp-Source: AGHT+IELREF70Up2YAdtx/7NQN0o7n6/aNs8KRX/U+++VvTfjhuXz6jvwWOLqD5CdkqeHZoooXpO X-Received: by 2002:aa7:9f49:0:b0:6f4:4319:4cea with SMTP id d2e1a72fcca58-705d71d2757mr5813986b3a.33.1718453579442; Sat, 15 Jun 2024 05:12:59 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718453579; cv=pass; d=google.com; s=arc-20160816; b=jdju0fnGJTJd79Wk6VlywZq4mby+ZlilLTIsy1Va2EVnRePTQZV2wWLAhXcb90L3Ft UVpXznMCOTdRghzGHhFeiI4ShS7d+yIj7uDKviTd5H2hAxMiR1+MhZr3lofJ8w/1MvXO BWWOgyAFaofiu6ZemDsuHljWW0OHteeemy343ekJJp5JEZv9HY3nuWNAnQgvgLDG4LTX ELMDE0Rv3PXpvvqDlarPujwOXwTuvziyXvBCs2xkkGvPC1sjseucP/F6hO/FmL92vXLa +bsAJZGbz3/9ns/f8tU6kmIYJCfWkMLVTzKV6KvHEswPGHtA0fmeSfKzNBvQPYoAJ0MG 3s3w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:content-transfer-encoding:references:in-reply-to:date:cc :to:from:subject:message-id:dkim-signature; bh=TDo4js3s4xpgK2ijGMMngiRH1/SS7TxO+AWgUyxaREk=; fh=iQherbPu9uesogBCz2ssnGdAxlsMJMXfr3s73kprXS0=; b=VeR1UczsUwz/DThajnTZrtk4I0agnCPhumQ4gme3GlznkiPvL4OFsmvHdC0gQtEfLL CNugvc5+PEni0tP1FZZ58Fqu5MB+LB0X0Nt9/YYnkCRRvCoRui3to1FRdW8XGfqOrdCw fDbp1eIj+sPgkXaoqhjGTWLvYyjJi3wWxi0BnoEPT39qcfaISqYQbpjB3l/swh6J8wAX JtZAfC3zmxXK7DdzBdJrGMNuP1xHgpIGckCfl4uc2+WbL49AtgmkxlvzL1LO0mUNnGZe 84F4N9s8ony4yfVgzxgtTCsUd1JP1smv98PqaYwo2eBB54gXF123c7NOyntpijiVKeOn ltqg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="C/fpvPYg"; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-215870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee558b6d0si5574120a12.643.2024.06.15.05.12.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 15 Jun 2024 05:12:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-215870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@xry111.site header.s=default header.b="C/fpvPYg"; arc=pass (i=1 spf=pass spfdomain=xry111.site dkim=pass dkdomain=xry111.site dmarc=pass fromdomain=xry111.site); spf=pass (google.com: domain of linux-kernel+bounces-215870-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-215870-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=xry111.site 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 sv.mirrors.kernel.org (Postfix) with ESMTPS id ED876282E8C for ; Sat, 15 Jun 2024 12:12:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A22C14594A; Sat, 15 Jun 2024 12:12:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b="C/fpvPYg" Received: from xry111.site (xry111.site [89.208.246.23]) (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 4EDCD44C68; Sat, 15 Jun 2024 12:12:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=89.208.246.23 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718453573; cv=none; b=BJ/MfBBHDAbF1kbFBQBn6XBxqxV0lnfvIeORyTyB1Tz0x+EdDOG3vU6PhKv9J0OhqHMW9lt2VU7+QOYUVAXyMQpT2QlZMYg2Ol/QjtRy+pZEu0wIsKCW6XWAvjKhtCf9cRat/ocIjgCk4fq2grFJq4ox95d0zaAnTOjMtISUhxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718453573; c=relaxed/simple; bh=Rie8EOS2HocIJQKELqDA8dhCoGwxflKqxoLfMmmwY6w=; h=Message-ID:Subject:From:To:Cc:Date:In-Reply-To:References: Content-Type:MIME-Version; b=WQB7IC+wWc2fve+dpnNNTteNJdBu2muQUhyYXJEPNuP/tiObphD/tKizEOPun5sw5PgwfB5lz94edzOopVQFVxKSB0LOHs0lugci+zF6J9V/u322M33nnpq5QK0w7tT8WmSjWmXiBhImQpLa3oJ4ceh5sjqhIOQ224FeJKehtcc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site; spf=pass smtp.mailfrom=xry111.site; dkim=pass (1024-bit key) header.d=xry111.site header.i=@xry111.site header.b=C/fpvPYg; arc=none smtp.client-ip=89.208.246.23 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=xry111.site Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=xry111.site DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=xry111.site; s=default; t=1718453570; bh=Rie8EOS2HocIJQKELqDA8dhCoGwxflKqxoLfMmmwY6w=; h=Subject:From:To:Cc:Date:In-Reply-To:References:From; b=C/fpvPYgKWoo9vhfwEBu7ePIrjNUfZm89ecgtFbty1xUipyRQN8Gi+eqtEf3+UjJy pINvUxh+nUSA8PWyPJCaJ8qo+kZ+06L6QfMcjK74tfq2IBqfGNJy4HEtxocDSjDCQ9 3x3t/KlMESJvr6y1K9BP8AEn6lrU5eUJ15e7YK+8= Received: from [127.0.0.1] (unknown [IPv6:2001:470:683e::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-384) server-digest SHA384) (Client did not present a certificate) (Authenticated sender: xry111@xry111.site) by xry111.site (Postfix) with ESMTPSA id 123C566E92; Sat, 15 Jun 2024 08:12:45 -0400 (EDT) Message-ID: <08ff168afc09fd108ec489a3c9360d4e704fa7dc.camel@xry111.site> Subject: Re: [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h From: Xi Ruoyao To: Arnd Bergmann , Huacai Chen 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 Date: Sat, 15 Jun 2024 20:12:43 +0800 In-Reply-To: <56ace686-d4b4-4b4c-a8a6-af06ec0d48f2@app.fastmail.com> References: <20240511100157.2334539-1-chenhuacai@loongson.cn> <56ace686-d4b4-4b4c-a8a6-af06ec0d48f2@app.fastmail.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 On Sat, 2024-06-15 at 13:47 +0200, Arnd Bergmann wrote: /* snip */ > > > > We can only wait for the seccomp side to be fixed now? Or we can ge= t > > > > this patch upstream for LoongArch64 at the moment, and wait for > > > > seccomp to fix RISCV32 (and LoongArch32) in future? > > >=20 > > > I'm wondering why not just introduce a new syscall or extend statx wi= th > > > a new flag, as we've discussed many times.=C2=A0 They have their own > > > disadvantages but better than this, IMO. > > We should move things forward, in any way. :) >=20 > Wouldn't it be sufficient to move the AT_EMPTY_PATH hack > from vfs_fstatat() to vfs_statx() so we can make them > behave the same way? >=20 > As far as I can tell, the only difference between the two is > that fstatat64() and similar already has added the check for > zero-length strings in order to make using vfs_fstatat() > fast and safe when called from glibc stat(). Do you mean https://git.kernel.org/torvalds/c/9013c51c630a? It (only partially) fix the performance issue but it won't help seccomp. The problem is you cannot check if the string is zero-length with seccomp. Thus seccomp cannot audit fstatat properly as well. In [Firefox] *all* fstatat (and statx) calls are trapped and *the signal handler* audit this fstatat call. If flags & AT_EMPTY_PATH and path is zero-length, it calls fstat to do the job. But on LoongArch there is no way to "do the job" as the only stat-family call is statx. [Firefox]:https://searchfox.org/mozilla-central/source/security/sandbox/lin= ux/SandboxFilter.cpp#364 --=20 Xi Ruoyao School of Aerospace Science and Technology, Xidian University