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] MR merged: keep `DAC_OVERRIDE` after changing the uid/gid
Date: Thu,  1 Dec 2022 06:30:37 +0000 (UTC)	[thread overview]
Message-ID: <41652.122120101303500517@us-mta-367.us.mimecast.lan> (raw)

Currently, the FUSE protocol doesn't send the process supplementary
groups. This causes some use cases to fail, for instance
(user belongs to "wheel"):

    # mkdir -m 0770 testdir
    # chgrp wheel testdir
    # su user -c "touch testdir/file"

it should succeed but fails with "Permission denied".

The Kata team also reported a database init failure due to lack of
support of supplementary groups:

"kata database failed due to permission issue in mssql/mariadb/pssql:
cannot create directory '/var/lib/mysql/data': Permission denied"

Although the actual solution requires a modification of the FUSE
protocol, and Miklos is working on a solution. In the meantime,
to work around this, we can set the `DAC_OVERRIDE` in the effective set
after changing the credentials. We are allowed to set the capability
because we only change the effective user ID, so we still have the
'DAC_OVERRIDE' in the permitted set.

An alternative workaround is to set `SECBIT_NO_SETUID_FIXUP` to avoid
clearing the caps effective set, but it has the disadvantage that we
must be careful and drop `FSETID` (and probably a few others) or we
risk introducing some security bugs, like CVE-2022-0358 [0].

The biggest drawback of this workaround, it will not work on top of
NFS (and probably also CEPH) and might be limited to local
filesystems.

[0] https://gitlab.com/virtio-fs/virtiofsd/-/merge_requests/77

This is a workaround for #59 

closes #30
---
https://gitlab.com/virtio-fs/virtiofsd/-/merge_requests/142


                 reply	other threads:[~2022-12-01  6:30 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=41652.122120101303500517@us-mta-367.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).