virtio-fs.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: virtiofs-bot@sinrega.org
To: virtio-fs@redhat.com
Subject: [Virtio-fs] [virtiofsd] Issue opened: xfs test generic/375 fails when using file handles
Date: Tue,  6 Sep 2022 15:33:06 +0000 (UTC)	[thread overview]
Message-ID: <89147.122090611330300221@us-mta-315.us.mimecast.lan> (raw)

The XFS test generic/375 only fails when using file handles. To reproduce the error just run (in the guest):

```
# mount -t virtiofs myfs /mnt
# cd /mnt
# touch testfile
# chown 100.100 testfile
# runas -u 100 -g 101 -- setfacl -m u::rwx,g::rwx,o::rwx testfile
setfacl: tesfile: Operation not permited
```
(runas is part of the xfs test suite)

virtiofsd has `CAP_DAC_READ_SEARCH` but (before calling setxattr) `open_by_handle_at()` returns `EPERM` anyway:

```rust
// passthrough/mod.rs
fn setxattr (..) {
     let file = self.open_inode(...) {
          data.open_file(...)
               // calls
               // passthrough/inode_store.rs
                FileOrHandle::Handle(h) => {
                    let new_file = h.open(flags)?;
                                      // calls
                                      // passthrough/file_handle.rs
                                      fn do_open(&self, mount_fd: &impl AsRawFd, flags: libc::c_int) -> io::Result<File> {
                                              let ret = unsafe { open_by_handle_at(mount_fd.as_raw_fd(), &self.handle.handle, flags) };
                                                                   ^--- this returns EPERM
```
---
https://gitlab.com/virtio-fs/virtiofsd/-/issues/56


                 reply	other threads:[~2022-09-06 15:33 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=89147.122090611330300221@us-mta-315.us.mimecast.lan \
    --to=virtiofs-bot@sinrega.org \
    --cc=virtio-fs@redhat.com \
    /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).