Fatih BAKIR
c703f5a163
[lld][Webassembly] Avoid a signed overflow on large sections ( #178287 )
...
wasm sections sizes are specified as u32s, and thus can be as large as
4GB. wasm-ld currently stores the offset into a section as an int32_t
which overflows on large sections and results in a crash. This change
makes it a int64_t to accommodate any valid wasm section and allow
catching even larger sections instead of wrapping around.
This PR fixes the issue by storing the offset as a int64_t, as well as
adding extra checks to handle un-encodeable sections to fail instead of
producing garbage wasm binaries, and also adds lit tests to make sure it
works. I confirmed the test fails on `main` but passes with this fix.
Fixes : #178286
2026-02-10 12:04:05 -08:00
..
2026-02-06 13:09:02 -08:00
2025-12-23 16:58:06 -08:00
2025-11-08 00:27:06 +00:00
2024-09-04 08:50:10 -07:00
2025-09-29 15:45:48 -07:00
2024-08-19 21:51:40 -07:00
2024-01-19 16:20:29 -08:00
2025-10-06 16:30:40 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-02-10 10:57:45 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2023-01-31 13:25:00 -08:00
2024-10-15 02:41:43 +09:00
2025-11-08 00:27:06 +00:00
2023-07-22 09:37:22 -07:00
2026-02-09 14:29:42 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-10-22 19:14:37 +08:00
2023-07-22 09:37:22 -07:00
2026-01-16 13:12:49 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-07-16 13:14:30 -07:00
2025-11-08 00:27:06 +00:00
2026-02-09 14:29:42 -08:00
2025-11-08 00:27:06 +00:00
2023-07-11 15:17:26 -07:00
2023-07-11 15:17:26 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-02-06 13:09:02 -08:00
2025-11-08 00:27:06 +00:00
2024-12-02 17:08:07 -08:00
2024-07-02 11:23:15 -07:00
2023-10-23 10:08:08 -07:00
2025-11-08 00:27:06 +00:00
2025-03-04 09:39:30 -08:00
2024-12-02 17:08:07 -08:00
2026-02-10 12:04:05 -08:00
2025-11-08 00:27:06 +00:00
2026-02-10 12:04:05 -08:00
2025-08-27 01:16:53 +00:00
2023-05-25 11:17:05 +02:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2023-07-11 15:17:26 -07:00
2024-02-07 11:51:19 -08:00
2025-11-08 00:27:06 +00:00
2026-01-29 09:27:22 -08:00
2025-11-08 00:27:06 +00:00
2026-02-09 14:29:42 -08:00
2024-07-12 13:26:52 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2026-01-29 16:47:03 -08:00
2026-01-29 16:47:03 -08:00
2025-08-19 09:46:10 -07:00
2025-11-08 00:27:06 +00:00
2025-09-03 09:12:12 -07:00
2025-02-28 11:12:52 -08:00
2025-11-03 14:42:05 -08:00
2023-07-22 09:37:22 -07:00
2026-02-10 12:04:05 -08:00
2024-07-12 13:26:52 -07:00
2025-01-28 16:06:01 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-07-12 13:26:52 -07:00
2024-09-30 17:17:58 -07:00
2025-02-10 10:35:44 -08:00
2024-07-12 13:26:52 -07:00
2024-06-21 15:56:02 -07:00
2023-01-31 13:25:00 -08:00
2024-07-12 13:26:52 -07:00
2025-11-08 00:27:06 +00:00
2024-01-22 10:04:26 -08:00
2025-11-08 00:27:06 +00:00
2024-09-11 11:22:46 -07:00
2023-11-02 14:23:45 -07:00
2024-06-20 09:48:25 -07:00
2024-06-20 09:48:25 -07:00
2025-11-08 00:27:06 +00:00
2025-09-19 10:11:15 -07:00
2024-11-04 16:12:57 -08:00
2025-11-08 00:27:06 +00:00
2024-09-30 17:17:58 -07:00
2023-01-31 13:25:00 -08:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2024-09-30 17:17:58 -07:00
2025-11-08 00:27:06 +00:00
2024-07-12 13:26:52 -07:00
2024-07-12 13:26:52 -07:00
2025-11-08 00:27:06 +00:00
2024-07-12 13:26:52 -07:00
2024-09-24 11:14:07 -07:00
2024-09-24 11:14:07 -07:00
2024-10-22 10:47:57 -07:00
2025-09-29 15:45:48 -07:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2025-11-08 00:27:06 +00:00
2023-03-06 17:52:49 -08:00
2025-11-27 19:21:09 +00:00