Chris Mason
fa0cd9b79f
dissect-image: fix wrong errno on pread failure
...
In acquire_sig_for_roothash() the pread() failure branch returns
-ENOMEM, which is copy-pasted from the malloc() check immediately
above it:
_cleanup_free_ char *buf = new(char, partition_size+1);
if (!buf)
return -ENOMEM;
ssize_t n = pread(fd, buf, partition_size, partition_offset);
if (n < 0)
return -ENOMEM;
pread() sets errno to the actual I/O failure (EIO, EINTR, EBADF,
...). Aliasing those to -ENOMEM misleads dissect_log_error() and
any caller that branches on the returned code; verity signature
lookup failures get reported as out-of-memory.
Fix by returning -errno from the pread() failure branch. The
malloc() branch above is correct and unchanged.
Fixes: 98ca65c36a ("dissect: check that roothash in signature matches before selecting partition")
Assisted-by: kres (claude-opus-4-7)
Signed-off-by: Chris Mason <clm@meta.com >
2026-05-22 22:14:48 +02:00
..
2026-05-05 11:14:33 +02:00
2026-05-21 16:09:25 +02:00
2026-04-30 11:12:33 +01:00
2026-05-18 02:55:56 +09:00
2026-05-22 05:09:56 +09:00
2026-04-30 11:12:33 +01:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-21 18:34:01 +02:00
2026-05-22 12:26:25 +02:00
2026-05-19 08:54:27 +02:00
2026-05-16 18:37:10 +02:00
2026-04-30 11:12:33 +01:00
2026-04-30 11:12:33 +01:00
2026-05-22 05:09:56 +09:00
2026-05-21 18:02:05 +02:00
2026-05-21 18:02:05 +02:00
2026-05-22 14:09:16 +01:00
2026-05-22 14:09:16 +01:00
2026-04-30 11:12:33 +01:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:36:08 +02:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-21 18:30:16 +02:00
2026-05-19 13:12:43 +01:00
2026-05-21 18:34:01 +02:00
2026-05-18 02:44:46 +09:00
2026-04-30 11:12:33 +01:00
2026-04-30 11:12:33 +01:00
2026-05-22 14:09:16 +01:00
2026-05-21 18:30:16 +02:00
2026-05-16 18:37:10 +02:00
2026-05-16 18:37:10 +02:00
2026-05-08 16:52:57 +02:00
2026-05-21 10:33:03 +09:00
2026-05-21 16:21:13 +02:00
2026-05-16 18:37:10 +02:00
2026-05-18 21:17:38 +00:00
2026-05-19 08:54:27 +02:00
2026-05-16 18:37:10 +02:00
2026-05-16 18:37:10 +02:00
2026-05-21 05:06:35 +09:00
2026-05-22 09:17:24 +01:00
2026-05-22 22:11:45 +09:00
2026-05-21 10:33:03 +09:00
2026-05-21 10:33:03 +09:00
2026-05-22 12:15:14 +02:00
2026-05-21 10:33:03 +09:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-14 08:12:28 +02:00
2026-05-21 18:02:05 +02:00
2026-04-30 08:05:54 +02:00
2026-05-05 13:49:51 +02:00
2026-05-05 17:23:16 +02:00
2026-05-22 06:44:07 +09:00
2026-05-21 18:02:05 +02:00
2026-05-21 10:33:03 +09:00
2026-05-21 17:20:30 +00:00
2026-05-21 10:33:03 +09:00
2026-05-18 21:42:56 +02:00
2026-04-30 11:12:33 +01:00
2026-05-22 12:15:12 +02:00
2026-05-21 21:44:06 +01:00
2026-05-18 21:17:38 +00:00
2026-05-18 21:17:38 +00:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-20 16:22:00 +02:00
2026-05-22 12:24:29 +02:00
2026-05-21 18:02:05 +02:00
2026-05-18 02:55:56 +09:00
2026-05-21 18:02:05 +02:00
2026-05-21 10:33:03 +09:00
2026-05-22 22:14:48 +02:00
2026-05-15 13:46:08 +01:00
2026-05-18 02:55:56 +09:00
2026-05-18 21:17:38 +00:00
2026-05-20 04:29:59 +09:00
2026-05-16 18:37:10 +02:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-04-30 11:12:33 +01:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-21 09:09:38 +09:00
2026-05-21 19:00:58 +01:00
2026-05-22 08:33:48 +09:00
2026-05-22 14:07:06 +01:00
2026-05-21 10:33:03 +09:00
2026-05-22 16:03:47 +01:00
2026-05-16 18:37:10 +02:00
2026-05-18 21:17:38 +00:00
2026-05-21 18:02:05 +02:00
2026-05-22 12:15:12 +02:00
2026-05-21 10:33:03 +09:00
2026-05-21 10:33:03 +09:00
2026-05-20 16:04:26 +00:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-18 21:17:38 +00:00
2026-04-30 11:12:33 +01:00
2026-05-16 18:37:10 +02:00
2026-05-20 16:34:21 +02:00
2026-05-16 18:37:10 +02:00
2026-05-20 23:39:47 +02:00
2026-04-30 11:12:33 +01:00