public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Cc: libc-alpha@sourceware.org
Subject: Re: [RFC] linux: Use fchmodat2 on fchmod for flags different than 0 (BZ 26401)
Date: Fri, 29 Sep 2023 12:43:00 +0200	[thread overview]
Message-ID: <87r0mh1cqz.fsf@oldenburg.str.redhat.com> (raw)
In-Reply-To: <20230928165621.372548-1-adhemerval.zanella@linaro.org> (Adhemerval Zanella's message of "Thu, 28 Sep 2023 13:56:21 -0300")

* Adhemerval Zanella:

> Linux 6.6 (09da082b07bbae1c) added support for fchmodat2, which is
> has similar semantic of fchmodat with an extra flag argument.  This
> allow fchmodat to implement AT_SYMLINK_NOFOLLOW and AT_EMPTY_PATH
> without the need to procfs.
>
> The syscall is registered on all architectures (with value of 452
> except on alpha which is 562, commit 78252deb023cf087).
>
> Checked on x86_64-linux-gnu on a 6.6 kernel.
>
> PS: setting it as RFC because there is no Linux 6.6 release yet.

Thanks for getting the work here started.

The syscall list update should definitely be in a separate commit.

> diff --git a/sysdeps/unix/sysv/linux/fchmodat.c b/sysdeps/unix/sysv/linux/fchmodat.c
> index 99527a3727..99d3df6440 100644
> --- a/sysdeps/unix/sysv/linux/fchmodat.c
> +++ b/sysdeps/unix/sysv/linux/fchmodat.c
> @@ -26,66 +26,80 @@
>  #include <sysdep.h>
>  #include <unistd.h>

diff -w makes the diff more manageable.

> +  /* The kernel system call does not have a mode argument.
> +     However, we can create an O_PATH descriptor and change that
> +     via /proc (which does not resolve symbolic links).  */

I would update the comment to mention the old fchmodat system call
explicitly.

The mechanics look okay to me.

I wonder how much breakage we are going to see due to EPERM instead of
ENOSYS on broken container runtimes.  We can certainly try to get the
world cleaned up for the glibc 2.39 release, we still have some time.

Thanks,
Florian


  reply	other threads:[~2023-09-29 10:43 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-28 16:56 Adhemerval Zanella
2023-09-29 10:43 ` Florian Weimer [this message]
2023-10-02 12:56   ` Adhemerval Zanella Netto

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=87r0mh1cqz.fsf@oldenburg.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=adhemerval.zanella@linaro.org \
    --cc=libc-alpha@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).