grub/grub-core
Patrick Steinhardt 1066336dc8 luks: Fix out-of-bounds copy of UUID
When configuring a LUKS disk, we copy over the UUID from the LUKS header
into the new grub_cryptodisk_t structure via grub_memcpy(). As size
we mistakenly use the size of the grub_cryptodisk_t UUID field, which
is guaranteed to be strictly bigger than the LUKS UUID field we're
copying. As a result, the copy always goes out-of-bounds and copies some
garbage from other surrounding fields. During runtime, this isn't
noticed due to the fact that we always NUL-terminate the UUID and thus
never hit the trailing garbage.

Fix the issue by using the size of the local stripped UUID field.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Reviewed-by: Daniel Kiper <daniel.kiper@oracle.com>
2020-09-11 15:47:39 +02:00
..
2020-07-29 16:55:47 +02:00
2020-09-11 15:47:39 +02:00
2020-07-29 16:55:48 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:48 +02:00
2020-07-29 16:55:47 +02:00
2020-07-29 16:55:48 +02:00
2020-07-29 16:55:47 +02:00
2020-09-11 15:45:56 +02:00
2017-08-14 16:27:10 +02:00
2017-05-03 12:49:31 +02:00
2013-04-27 02:00:16 +02:00
2019-02-25 14:02:05 +01:00
2017-05-03 12:49:31 +02:00