]> git.ipfire.org Git - thirdparty/grub.git/commit
luks2: Make sure all fields of output argument in luks2_parse_digest() are written to
authorGlenn Washburn <development@efficientek.com>
Tue, 8 Dec 2020 22:45:36 +0000 (16:45 -0600)
committerDaniel Kiper <daniel.kiper@oracle.com>
Sat, 12 Dec 2020 00:19:04 +0000 (01:19 +0100)
commit7904c5ce678a3809df5e4562989796f44197c74e
treef64361768f9d45a1084ef580d0f020a497af21ab
parentfe902c3f4c74edf83fbcd38c432d7ea357f9a51c
luks2: Make sure all fields of output argument in luks2_parse_digest() are written to

We should assume that the output argument "out" is uninitialized and could
have random data. So, make sure to initialize the segments and keyslots bit
fields because potentially not all bits of those fields are written to.
Otherwise, the digest could say it belongs to keyslots and segments that it
does not.

Signed-off-by: Glenn Washburn <development@efficientek.com>
Reviewed-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
grub-core/disk/luks2.c