Skip to content

Commit b1288df

Browse files
committed
virtiofsd: Terminate capability list
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: a59feb4 ("virtiofsd: only retain file system capabilities") Signed-off-by: Dr. David Alan Gilbert <[email protected]> Reviewed-by: Stefan Hajnoczi <[email protected]> Acked-by: Vivek Goyal <[email protected]> Message-Id: <[email protected]> Signed-off-by: Dr. David Alan Gilbert <[email protected]>
1 parent 6651620 commit b1288df

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

tools/virtiofsd/passthrough_ll.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2598,7 +2598,9 @@ static void setup_capabilities(void)
25982598
CAP_SETGID,
25992599
CAP_SETUID,
26002600
CAP_MKNOD,
2601-
CAP_SETFCAP);
2601+
CAP_SETFCAP,
2602+
-1);
2603+
26022604
capng_apply(CAPNG_SELECT_BOTH);
26032605

26042606
cap.saved = capng_save_state();

0 commit comments

Comments
 (0)