Generic Linux architectural discussions
 help / color / mirror / Atom feed
From: Xi Ruoyao <xry111@xry111.site>
To: Arnd Bergmann <arnd@arndb.de>, Huacai Chen <chenhuacai@kernel.org>
Cc: Huacai Chen <chenhuacai@loongson.cn>,
	loongarch@lists.linux.dev,
	Linux-Arch <linux-arch@vger.kernel.org>,
	Xuefeng Li <lixuefeng@loongson.cn>, guoren <guoren@kernel.org>,
	WANG Xuerui <kernel@xen0n.name>,
	Jiaxun Yang <jiaxun.yang@flygoat.com>,
	linux-kernel@vger.kernel.org,  loongson-kernel@lists.loongnix.cn,
	stable@vger.kernel.org
Subject: Re: [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h
Date: Sat, 15 Jun 2024 20:12:43 +0800	[thread overview]
Message-ID: <08ff168afc09fd108ec489a3c9360d4e704fa7dc.camel@xry111.site> (raw)
In-Reply-To: <56ace686-d4b4-4b4c-a8a6-af06ec0d48f2@app.fastmail.com>

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 get
> > > > this patch upstream for LoongArch64 at the moment, and wait for
> > > > seccomp to fix RISCV32 (and LoongArch32) in future?
> > > 
> > > I'm wondering why not just introduce a new syscall or extend statx with
> > > a new flag, as we've discussed many times.  They have their own
> > > disadvantages but better than this, IMO.
> > We should move things forward, in any way. :)
> 
> 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?
> 
> 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/linux/SandboxFilter.cpp#364

-- 
Xi Ruoyao <xry111@xry111.site>
School of Aerospace Science and Technology, Xidian University

  reply	other threads:[~2024-06-15 12:12 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-11 10:01 [PATCH] LoongArch: Define __ARCH_WANT_NEW_STAT in unistd.h Huacai Chen
2024-05-11 12:17 ` Arnd Bergmann
2024-05-11 14:28   ` Huacai Chen
2024-05-11 15:38     ` Arnd Bergmann
2024-05-12  3:11       ` Huacai Chen
2024-05-12  7:52         ` Arnd Bergmann
2024-06-15  8:52           ` Huacai Chen
2024-06-15  8:55             ` Xi Ruoyao
2024-06-15  9:29               ` Huacai Chen
2024-06-15 11:47                 ` Arnd Bergmann
2024-06-15 12:12                   ` Xi Ruoyao [this message]
2024-06-15 13:12                     ` Xi Ruoyao
2024-06-17  6:35                       ` Arnd Bergmann
2024-06-17  6:45                         ` Xi Ruoyao
2024-06-17  6:53                           ` Arnd Bergmann
2024-06-22  7:45                           ` Huacai Chen
2024-06-22 11:04                             ` Xi Ruoyao
2024-05-15  9:30   ` maobibo
2024-05-15 14:25     ` Arnd Bergmann
2024-05-16  2:52       ` maobibo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=08ff168afc09fd108ec489a3c9360d4e704fa7dc.camel@xry111.site \
    --to=xry111@xry111.site \
    --cc=arnd@arndb.de \
    --cc=chenhuacai@kernel.org \
    --cc=chenhuacai@loongson.cn \
    --cc=guoren@kernel.org \
    --cc=jiaxun.yang@flygoat.com \
    --cc=kernel@xen0n.name \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lixuefeng@loongson.cn \
    --cc=loongarch@lists.linux.dev \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox