Skip to content

Commit 662d0c5

Browse files
Maxim LevitskyXanClic
authored andcommitted
block/crypto: disallow write sharing by default
My commit 'block/crypto: implement the encryption key management' accidently allowed raw luks images to be shared between different qemu processes without share-rw=on explicit override. Fix that. Fixes: bbfdae9 ("block/crypto: implement the encryption key management") Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1857490 Signed-off-by: Maxim Levitsky <[email protected]> Message-Id: <[email protected]> Signed-off-by: Max Reitz <[email protected]>
1 parent af3d690 commit 662d0c5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

block/crypto.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,7 @@ block_crypto_child_perms(BlockDriverState *bs, BdrvChild *c,
881881
* For backward compatibility, manually share the write
882882
* and resize permission
883883
*/
884-
*nshared |= (BLK_PERM_WRITE | BLK_PERM_RESIZE);
884+
*nshared |= shared & (BLK_PERM_WRITE | BLK_PERM_RESIZE);
885885
/*
886886
* Since we are not fully a format driver, don't always request
887887
* the read/resize permission but only when explicitly

0 commit comments

Comments
 (0)