OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto: strengthen the check for key slots overlapping with LUKS header
[qmiga/qemu.git]
/
crypto
/
block-luks.c
diff --git
a/crypto/block-luks.c
b/crypto/block-luks.c
index
f22bc63
..
e6ee850
100644
(file)
--- a/
crypto/block-luks.c
+++ b/
crypto/block-luks.c
@@
-602,7
+602,7
@@
qcrypto_block_luks_check_header(const QCryptoBlockLUKS *luks, Error **errp)
return -1;
}
return -1;
}
- if (start1 < DIV_ROUND_UP(
sizeof(QCryptoBlockLUKSHeader)
,
+ if (start1 < DIV_ROUND_UP(
QCRYPTO_BLOCK_LUKS_KEY_SLOT_OFFSET
,
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) {
error_setg(errp,
"Keyslot %zu is overlapping with the LUKS header",
QCRYPTO_BLOCK_LUKS_SECTOR_SIZE)) {
error_setg(errp,
"Keyslot %zu is overlapping with the LUKS header",