[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 1/5] virtiofsd: Terminate capability list
From: |
Dr. David Alan Gilbert (git) |
Subject: |
[PULL 1/5] virtiofsd: Terminate capability list |
Date: |
Fri, 3 Jul 2020 16:27:44 +0100 |
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>
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Message-Id: <20200629115420.98443-2-dgilbert@redhat.com>
Signed-off-by: Dr. David Alan Gilbert <dgilbert@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
- [PULL 0/5] migration queue, Dr. David Alan Gilbert (git), 2020/07/03
- [PULL 1/5] virtiofsd: Terminate capability list,
Dr. David Alan Gilbert (git) <=
- [PULL 2/5] virtiofsd: Check capability calls, Dr. David Alan Gilbert (git), 2020/07/03
- [PULL 3/5] virtiofsd: Allow addition or removal of capabilities, Dr. David Alan Gilbert (git), 2020/07/03
- [PULL 4/5] migration: postcopy take proper error return, Dr. David Alan Gilbert (git), 2020/07/03
- [PULL 5/5] migration: Count new_dirty instead of real_dirty, Dr. David Alan Gilbert (git), 2020/07/03
- Re: [PULL 0/5] migration queue, Peter Maydell, 2020/07/04