OSDN Git Service

crypto: sanity check that LUKS header strings are NUL-terminated
authorDaniel P. Berrangé <berrange@redhat.com>
Tue, 10 May 2022 13:17:43 +0000 (14:17 +0100)
committerDaniel P. Berrangé <berrange@redhat.com>
Thu, 27 Oct 2022 11:55:27 +0000 (12:55 +0100)
commitc1d8634c207defb547a57515729233e47f65718f
treea4f556b2db9b25aa876687d2d4aaab5fbc72cff2
parentf1018ea0a30f577d1e3515d0a6362e362a0cb86f
crypto: sanity check that LUKS header strings are NUL-terminated

The LUKS spec requires that header strings are NUL-terminated, and our
code relies on that. Protect against maliciously crafted headers by
adding validation.

Reviewed-by: Richard W.M. Jones <rjones@redhat.com>
Signed-off-by: Daniel P. Berrangé <berrange@redhat.com>
crypto/block-luks.c