Skip to content

Commit

Permalink
virtiofsd: Fix security.capability comparison
Browse files Browse the repository at this point in the history
My security fix for the security.capability remap has a silly early
segfault in a simple case where there is an xattrmapping but it doesn't
remap the security.capability.

Fixes: e586edc ("virtiofs: drop remapped security.capability xattr as needed")
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
Message-Id: <[email protected]>
Reviewed-by: Connor Kuehl <[email protected]>
Signed-off-by: Dr. David Alan Gilbert <[email protected]>
  • Loading branch information
dagrh committed Apr 6, 2021
1 parent d0d3dd4 commit 99c3ac6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tools/virtiofsd/passthrough_ll.c
Original file line number Diff line number Diff line change
Expand Up @@ -2636,7 +2636,8 @@ static void parse_xattrmap(struct lo_data *lo)
strerror(ret));
exit(1);
}
if (!strcmp(lo->xattr_security_capability, "security.capability")) {
if (!lo->xattr_security_capability ||
!strcmp(lo->xattr_security_capability, "security.capability")) {
/* 1-1 mapping, don't need to do anything */
free(lo->xattr_security_capability);
lo->xattr_security_capability = NULL;
Expand Down

0 comments on commit 99c3ac6

Please sign in to comment.