Arnaldo Carvalho de Melo
6eaa8ee3e2
perf symbols: Fix signed overflow in sysfs__read_build_id() size check
...
sysfs__read_build_id() reads ELF note headers from sysfs files. The
note's namesz and descsz fields are used to compute the skip size:
int n = namesz + descsz;
if (n > (int)sizeof(bf))
Both namesz and descsz are size_t from NOTE_ALIGN() of 32-bit note
header fields. Their sum can exceed INT_MAX, overflowing the signed
int n to a negative value. The check n > sizeof(bf) then evaluates
false (negative < positive in signed comparison), and read(fd, bf, n)
reinterprets the negative n as a huge size_t count — the kernel writes
up to MAX_RW_COUNT bytes into the 8192-byte stack buffer.
In practice the overflow is bounded by the sysfs file's actual size,
so a real sysfs notes file won't trigger it organically. But crafted
input (e.g. via a mounted debugfs/sysfs image) could.
Fix by validating namesz and descsz individually against the buffer
size before summing, and change n to size_t to avoid the signed
overflow entirely.
Fixes: f1617b4059 ("perf symbols: Record the build_ids of kernel modules too")
Reported-by: sashiko-bot <sashiko-bot@kernel.org >
Cc: Namhyung Kim <namhyung@kernel.org >
Assisted-by: Claude:claude-opus-4.6
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com >
2026-06-10 18:56:01 -03:00
..
2026-04-13 23:41:11 -07:00
2026-05-05 22:04:28 -03:00
2026-06-04 17:34:52 -03:00
2026-06-10 18:55:48 -03:00
2026-01-20 15:43:56 -03:00
2025-11-13 23:03:11 -08:00
2026-01-20 15:43:56 -03:00
2025-11-13 23:03:11 -08:00
2026-05-20 16:35:59 -03:00
2026-05-15 16:19:50 -03:00
2026-05-20 13:29:23 -03:00
2026-06-03 16:53:45 -03:00
2026-04-08 10:28:49 -07:00
2026-04-08 10:28:49 -07:00
2026-01-23 16:58:39 -03:00
2026-01-23 16:58:39 -03:00
2026-04-01 14:50:53 -07:00
2025-06-20 13:14:07 -07:00
2026-05-22 21:32:12 -03:00
2026-05-05 21:51:59 -03:00
2026-03-19 14:42:29 -07:00
2026-06-03 16:53:45 -03:00
2026-05-20 16:35:59 -03:00
2026-05-14 20:50:00 -03:00
2026-05-14 20:50:00 -03:00
2026-05-29 11:44:19 -03:00
2025-09-19 12:14:28 -03:00
2026-06-04 19:17:36 -03:00
2025-12-03 11:01:05 -08:00
2026-01-13 17:03:25 -03:00
2026-01-13 17:03:25 -03:00
2026-04-08 10:28:49 -07:00
2024-08-14 10:20:40 -03:00
2026-04-08 19:21:04 -07:00
2026-05-25 16:46:17 -03:00
2026-04-08 19:21:04 -07:00
2025-10-01 15:27:02 -03:00
2025-11-13 23:03:11 -08:00
2026-04-01 14:50:53 -07:00
2026-05-22 20:51:59 -03:00
2026-06-04 17:34:52 -03:00
2026-04-08 19:21:04 -07:00
2026-04-01 14:50:53 -07:00
2026-06-10 15:23:53 -03:00
2025-06-20 14:48:49 -07:00
2025-09-30 13:36:03 -03:00
2025-11-13 23:03:11 -08:00
2025-03-24 17:29:58 -07:00
2024-08-28 18:21:49 -03:00
2026-05-20 17:46:45 -03:00
2026-01-14 17:22:50 -03:00
2025-10-03 16:49:51 -03:00
2025-07-25 10:37:56 -07:00
2026-03-13 14:13:02 -07:00
2024-12-09 17:52:41 -03:00
2024-12-09 17:52:41 -03:00
2026-06-04 17:34:52 -03:00
2026-06-10 15:23:53 -03:00
2026-05-20 16:34:23 -03:00
2023-05-28 10:24:14 -03:00
2023-02-16 09:33:45 -03:00
2026-06-06 14:42:19 -03:00
2026-06-06 14:42:19 -03:00
2026-01-14 17:22:50 -03:00
2025-06-09 11:18:17 -07:00
2026-06-03 16:45:43 -03:00
2026-02-03 11:34:02 -03:00
2026-04-05 23:23:33 -07:00
2025-07-11 12:36:40 -07:00
2026-04-02 19:35:16 -07:00
2023-03-14 08:29:46 -03:00
2025-03-10 11:31:24 -07:00
2024-10-10 23:38:33 -07:00
2025-03-10 11:31:24 -07:00
2025-06-11 13:40:31 -07:00
2025-03-10 14:37:02 -07:00
2026-05-15 08:25:02 -03:00
2025-03-10 11:31:24 -07:00
2022-10-27 16:37:25 -03:00
2022-10-27 16:37:25 -03:00
2026-06-10 11:38:45 -03:00
2024-05-07 18:06:44 -03:00
2026-04-01 14:50:53 -07:00
2023-02-19 08:03:12 -03:00
2023-04-04 09:39:56 -03:00
2026-06-10 18:55:48 -03:00
2026-06-10 18:55:48 -03:00
2026-06-04 17:34:52 -03:00
2026-06-10 17:05:48 -03:00
2026-06-04 17:34:52 -03:00
2026-04-08 19:21:17 -07:00
2026-04-08 19:21:17 -07:00
2026-05-20 16:35:59 -03:00
2026-05-20 16:35:59 -03:00
2026-04-08 19:21:04 -07:00
2025-06-25 10:59:19 -07:00
2026-05-05 21:52:51 -03:00
2024-10-18 10:17:40 -07:00
2023-03-20 12:49:58 -03:00
2025-05-28 19:02:58 -03:00
2026-01-27 02:33:29 -03:00
2025-05-09 17:00:05 -03:00
2025-05-09 17:00:05 -03:00
2026-04-13 23:41:11 -07:00
2026-04-13 23:41:11 -07:00
2026-06-03 16:53:45 -03:00
2026-03-03 17:04:49 -08:00
2025-06-25 11:12:35 -07:00
2026-06-10 15:23:53 -03:00
2026-06-03 16:45:21 -03:00
2026-04-08 19:21:05 -07:00
2024-08-19 14:52:13 -03:00
2024-09-03 12:22:01 -03:00
2026-05-05 21:48:45 -03:00
2026-05-05 21:48:45 -03:00
2026-01-20 15:43:56 -03:00
2026-06-03 16:53:16 -03:00
2026-06-06 13:44:46 -03:00
2026-06-10 11:38:45 -03:00
2026-01-22 12:29:28 -03:00
2025-02-18 14:04:32 -08:00
2026-05-22 21:37:34 -03:00
2026-03-19 14:42:46 -07:00
2026-01-14 23:14:54 -03:00
2026-06-03 16:53:45 -03:00
2023-05-12 15:21:49 -03:00
2026-05-29 21:20:50 -03:00
2026-05-29 21:20:50 -03:00
2025-11-13 23:03:11 -08:00
2023-01-23 10:00:47 -03:00
2026-06-04 10:58:47 -03:00
2026-06-04 10:58:47 -03:00
2026-06-04 10:58:47 -03:00
2026-06-04 10:58:47 -03:00
2025-05-13 16:36:22 -03:00
2025-05-13 16:36:22 -03:00
2025-07-22 17:47:22 -07:00
2023-06-20 22:18:58 -07:00
2026-01-13 17:03:28 -03:00
2024-10-18 10:17:40 -07:00
2022-11-09 20:45:14 -08:00
2024-10-14 12:04:31 -07:00
2026-06-03 16:53:16 -03:00
2026-04-05 22:30:52 -07:00
2024-03-21 13:54:40 -03:00
2024-08-12 18:05:14 -03:00
2022-10-15 10:13:16 -03:00
2026-06-10 15:23:53 -03:00
2026-05-20 16:39:36 -03:00
2026-06-10 15:23:53 -03:00
2025-10-01 09:44:02 -03:00
2026-05-20 16:11:30 -03:00
2026-06-03 16:53:45 -03:00
2023-10-17 12:40:50 -07:00
2026-06-04 11:35:04 -03:00
2025-04-25 12:31:36 -03:00
2022-11-24 09:40:37 -03:00
2022-11-24 09:40:37 -03:00
2024-08-19 14:51:46 -03:00
2026-06-10 18:55:49 -03:00
2026-06-04 11:41:46 -03:00
2026-05-20 16:35:59 -03:00
2026-05-20 16:35:59 -03:00
2026-05-29 11:44:35 -03:00
2026-04-08 10:28:49 -07:00
2025-11-26 10:13:38 -08:00
2026-06-03 16:53:45 -03:00
2026-01-20 13:04:38 -03:00
2025-01-08 17:38:32 -03:00
2024-09-03 10:39:20 -03:00
2026-03-04 18:05:18 -08:00
2025-10-06 16:47:49 -03:00
2026-06-03 16:50:34 -03:00
2025-05-09 14:32:15 -03:00
2026-01-14 17:22:50 -03:00
2026-06-03 16:53:45 -03:00
2026-06-03 16:46:37 -03:00
2026-01-23 16:58:39 -03:00
2026-01-23 16:58:39 -03:00
2025-10-02 15:36:13 -03:00
2025-10-02 15:36:13 -03:00
2026-05-15 16:19:50 -03:00
2026-05-15 16:19:50 -03:00
2026-04-08 19:21:05 -07:00
2025-12-03 11:07:46 -08:00
2025-05-02 15:36:14 -03:00
2024-08-01 18:55:55 -03:00
2024-08-01 18:55:55 -03:00
2026-06-04 17:34:52 -03:00
2025-11-03 20:57:21 -08:00
2026-06-10 13:13:32 -03:00
2025-02-10 11:46:02 -08:00
2025-11-13 17:55:19 -03:00
2025-11-13 17:55:19 -03:00
2025-10-03 15:28:04 -03:00
2025-01-08 17:31:06 -03:00
2025-05-05 21:51:54 -03:00
2026-04-02 19:35:16 -07:00
2022-07-20 11:07:30 -03:00
2023-11-09 13:47:50 -03:00
2026-06-04 11:03:52 -03:00
2025-11-24 12:20:06 -08:00
2025-11-24 12:20:06 -08:00
2025-10-15 23:59:11 +09:00
2026-02-06 12:16:09 -03:00
2024-12-23 13:53:08 -03:00
2024-12-23 13:53:08 -03:00
2025-10-15 23:59:10 +09:00
2026-05-29 11:44:33 -03:00
2026-05-20 13:29:23 -03:00
2026-05-20 13:29:23 -03:00
2023-01-02 12:34:06 -03:00
2025-11-13 23:03:11 -08:00
2022-11-24 10:04:52 -03:00
2026-06-10 18:56:01 -03:00
2026-02-10 09:34:44 -03:00
2023-04-06 21:40:28 -03:00
2023-09-12 17:47:00 -03:00
2026-05-14 20:59:08 -03:00
2026-05-14 20:59:08 -03:00
2026-04-08 19:21:05 -07:00
2025-10-01 11:22:04 -03:00
2026-06-03 16:46:07 -03:00
2026-06-03 16:46:07 -03:00
2026-01-21 11:01:22 -03:00
2025-10-15 23:59:11 +09:00
2026-06-03 16:53:45 -03:00
2024-12-10 15:41:10 -03:00
2026-04-08 19:21:05 -07:00
2024-11-16 17:07:31 -03:00
2026-05-05 21:50:56 -03:00
2025-02-26 14:25:14 -08:00
2025-03-10 11:31:24 -07:00
2025-03-10 11:31:24 -07:00
2025-12-02 16:12:49 -08:00
2024-03-21 10:41:28 -03:00
2025-12-17 09:30:37 -03:00
2023-10-25 10:02:11 -07:00
2023-10-25 10:02:11 -07:00
2025-05-21 15:07:13 -03:00
2025-05-21 15:07:13 -03:00
2023-11-15 12:51:53 -05:00
2025-07-25 10:37:56 -07:00
2026-05-20 16:39:40 -03:00
2026-06-03 16:48:00 -03:00
2026-06-03 16:48:00 -03:00
2026-04-05 23:12:15 -07:00
2026-06-03 16:31:03 -03:00
2026-06-03 16:42:52 -03:00
2026-05-29 11:44:11 -03:00
2026-06-10 17:00:40 -03:00
2023-06-20 17:03:43 -07:00
2023-06-20 17:03:43 -07:00
2022-04-01 16:19:35 -03:00
2023-02-19 08:03:12 -03:00
2023-02-19 08:03:12 -03:00
2026-06-03 16:53:45 -03:00
2026-03-26 15:22:18 -07:00
2025-07-11 12:36:40 -07:00
2025-07-11 12:36:40 -07:00
2025-05-13 16:36:22 -03:00
2026-06-03 16:53:45 -03:00
2026-05-05 21:49:18 -03:00
2026-05-22 17:25:02 -03:00
2026-06-04 10:58:47 -03:00
2026-04-01 14:50:53 -07:00
2026-02-06 18:18:32 -03:00
2024-12-23 13:53:08 -03:00
2024-12-23 13:53:08 -03:00
2023-04-06 21:41:00 -03:00
2024-11-14 16:56:32 -03:00
2024-12-12 15:53:36 -03:00
2026-01-27 21:19:24 -03:00
2026-01-27 21:19:24 -03:00
2026-06-06 14:27:52 -03:00
2026-05-15 08:25:02 -03:00
2026-06-03 16:53:45 -03:00
2026-06-10 18:56:01 -03:00
2025-12-17 07:30:51 -08:00
2026-06-03 16:54:09 -03:00
2026-06-03 16:54:09 -03:00
2023-02-01 21:51:51 -03:00
2026-05-29 11:44:32 -03:00
2026-05-20 16:39:40 -03:00
2025-06-09 11:18:18 -07:00
2026-03-19 14:42:46 -07:00
2026-01-27 21:19:24 -03:00
2025-06-09 11:18:18 -07:00
2026-01-27 01:35:47 -03:00
2026-06-03 16:45:21 -03:00
2026-06-03 16:45:21 -03:00
2024-10-14 12:04:31 -07:00
2024-03-03 22:52:13 -08:00
2026-01-27 02:31:29 -03:00
2026-05-22 21:37:34 -03:00
2026-05-22 21:37:34 -03:00
2026-05-29 11:44:34 -03:00
2026-05-20 16:34:23 -03:00
2025-06-09 11:18:18 -07:00
2025-06-09 11:18:18 -07:00
2023-02-19 08:07:24 -03:00
2023-02-19 08:07:24 -03:00
2026-01-27 02:22:00 -03:00
2025-07-26 16:31:43 -07:00
2025-06-26 10:31:05 -07:00
2026-01-27 02:26:48 -03:00
2024-12-09 17:52:42 -03:00
2024-11-08 22:42:57 -08:00
2026-05-20 16:39:40 -03:00
2024-11-08 22:42:57 -08:00
2026-05-20 16:39:40 -03:00
2025-09-19 12:14:29 -03:00
2024-05-09 18:46:43 -03:00
2024-05-09 18:46:43 -03:00
2026-05-29 11:44:19 -03:00
2024-10-10 23:40:32 -07:00
2026-01-27 02:28:33 -03:00
2026-05-15 08:25:02 -03:00
2026-01-26 18:31:27 -03:00
2026-05-15 16:19:50 -03:00
2026-05-15 08:25:02 -03:00
2026-05-15 16:19:50 -03:00
2023-04-10 19:20:53 -03:00
2026-05-29 21:17:25 -03:00
2026-04-08 19:21:05 -07:00
2026-04-08 19:21:05 -07:00
2024-12-23 13:53:08 -03:00
2024-09-27 15:38:52 -03:00
2025-09-12 15:41:57 -03:00
2026-05-29 11:44:27 -03:00