From: "Dr. David Alan Gilbert (git)" <dgilbert@redhat.com>
To: qemu-devel@nongnu.org, virtio-fs@redhat.com, stefanha@redhat.com,
vgoyal@redhat.com
Subject: [PATCH v2 1/3] virtiofsd: Terminate capability list
Date: Mon, 29 Jun 2020 12:54:18 +0100 [thread overview]
Message-ID: <20200629115420.98443-2-dgilbert@redhat.com> (raw)
In-Reply-To: <20200629115420.98443-1-dgilbert@redhat.com>
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
capng_updatev is a varargs function that needs a -1 to terminate it,
but it was missing.
In practice what seems to have been happening is that it's added the
capabilities we asked for, then runs into junk on the stack, so if
we're unlucky it might be adding some more, but in reality it's
failing - but after adding the capabilities we asked for.
Fixes: a59feb483b8 ("virtiofsd: only retain file system capabilities")
Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
---
tools/virtiofsd/passthrough_ll.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/tools/virtiofsd/passthrough_ll.c b/tools/virtiofsd/passthrough_ll.c
index 2ce7c96085..e373e3b36e 100644
--- a/tools/virtiofsd/passthrough_ll.c
+++ b/tools/virtiofsd/passthrough_ll.c
@@ -2598,7 +2598,9 @@ static void setup_capabilities(void)
CAP_SETGID,
CAP_SETUID,
CAP_MKNOD,
- CAP_SETFCAP);
+ CAP_SETFCAP,
+ -1);
+
capng_apply(CAPNG_SELECT_BOTH);
cap.saved = capng_save_state();
--
2.26.2
next prev parent reply other threads:[~2020-06-29 11:55 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-29 11:54 [PATCH v2 0/3] virtiofsd capability changes and addition Dr. David Alan Gilbert (git)
2020-06-29 11:54 ` Dr. David Alan Gilbert (git) [this message]
2020-06-29 11:54 ` [PATCH v2 2/3] virtiofsd: Check capability calls Dr. David Alan Gilbert (git)
2020-06-29 11:54 ` [PATCH v2 3/3] virtiofsd: Allow addition or removal of capabilities Dr. David Alan Gilbert (git)
2020-06-29 13:56 ` [PATCH v2 0/3] virtiofsd capability changes and addition Vivek Goyal
2020-06-30 8:38 ` Stefan Hajnoczi
2020-07-03 12:06 ` Dr. David Alan Gilbert
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=20200629115420.98443-2-dgilbert@redhat.com \
--to=dgilbert@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=vgoyal@redhat.com \
--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 NNTP newsgroup(s).