luks: Catch integer overflow for huge sizes
commit3d7ed9c453ad10e73edbcde1b718506ed7b86388
authorKevin Wolf <kwolf@redhat.com>
Mon, 5 Mar 2018 17:15:26 +0000 (5 18:15 +0100)
committerKevin Wolf <kwolf@redhat.com>
Mon, 19 Mar 2018 11:01:24 +0000 (19 12:01 +0100)
tree916f65c89af6e3854f841fe66e0e1bb1e0249ca9
parente39e959e89b33bc0e17a702db42ea8a5f3763133
luks: Catch integer overflow for huge sizes

When you request an image size close to UINT64_MAX, the addition of the
crypto header may cause an integer overflow. Catch it instead of
silently truncating the image size.

Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
block/crypto.c