mirror of
https://github.com/morgan9e/systemd
synced 2026-04-14 08:25:20 +09:00
repart: add extra safety check that the verity signature fits in the partition we want to write
This commit is contained in:
@@ -4159,6 +4159,9 @@ static int partition_format_verity_sig(Context *context, Partition *p) {
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to format verity signature JSON object: %m");
|
||||
|
||||
if (strlen(text)+1 > p->new_size)
|
||||
return log_error_errno(SYNTHETIC_ERRNO(E2BIG), "Verity signature too long for partition: %m");
|
||||
|
||||
r = strgrowpad0(&text, p->new_size);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to pad string to %s", FORMAT_BYTES(p->new_size));
|
||||
|
||||
Reference in New Issue
Block a user