aboutsummaryrefslogtreecommitdiff
path: root/scsi
diff options
context:
space:
mode:
authorVivek Goyal <vgoyal@redhat.com>2022-02-08 15:48:12 -0500
committerDr. David Alan Gilbert <dgilbert@redhat.com>2022-02-17 17:22:26 +0000
commita675c9a600389d210882fd1511edc2be65d53cdc (patch)
treee6b157316ae9f9a598d9909ec9388869249c9c34 /scsi
parent0c3f81e13184ef0dc4b7c1a2afc15cb77fdad99b (diff)
downloadqemu-a675c9a600389d210882fd1511edc2be65d53cdc.zip
qemu-a675c9a600389d210882fd1511edc2be65d53cdc.tar.gz
qemu-a675c9a600389d210882fd1511edc2be65d53cdc.tar.bz2
virtiofsd: Create new file using O_TMPFILE and set security context
If guest and host policies can't work with each other, then guest security context (selinux label) needs to be set into an xattr. Say remap guest security.selinux xattr to trusted.virtiofs.security.selinux. That means setting "fscreate" is not going to help as that's ony useful for security.selinux xattr on host. So we need another method which is atomic. Use O_TMPFILE to create new file, set xattr and then linkat() to proper place. But this works only for regular files. So dir, symlinks will continue to be non-atomic. Also if host filesystem does not support O_TMPFILE, we fallback to non-atomic behavior. Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com> Signed-off-by: Vivek Goyal <vgoyal@redhat.com> Message-Id: <20220208204813.682906-10-vgoyal@redhat.com> Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Diffstat (limited to 'scsi')
0 files changed, 0 insertions, 0 deletions