Petr Beneš
6558595ca3
[LLD][COFF] Fix out-of-bounds write when filling gaps with INT3 in code sections ( #180411 )
...
When merging `.bss` into a code section (e.g., `/MERGE:.bss=.text`), the
INT3 gap-filling loop in `writeSections()` would write past the output
buffer. This happens because `.bss` chunks have `hasData=false`, so they
contribute to `VirtualSize` but not `SizeOfRawData`. The loop was using
chunk RVAs without checking if they exceeded the raw data region.
This caused a crash on Windows with `/FILEALIGN:1` (access violation
0xC0000005). The tight alignment leaves no slack in the mapped buffer,
so the overflow immediately hits unmapped memory.
The fix bounds all memset operations to `rawSize` and exits early when
encountering chunks beyond the raw data boundary.
Fixes #180406
2026-02-10 13:26:03 +00:00
..
2025-07-20 14:47:00 +01:00
2025-12-18 23:15:33 +02:00
2025-10-29 10:35:20 +00:00
2025-07-28 19:26:25 +02:00
2025-07-28 19:26:25 +02:00
2025-07-28 19:26:25 +02:00
2025-08-22 13:05:19 +02:00
2025-10-13 23:01:17 +03:00
2025-07-28 19:26:25 +02:00
2025-11-17 12:44:22 +01:00
2025-07-28 17:45:16 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-04-11 16:13:46 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-10-13 23:01:17 +03:00
2025-02-07 15:52:39 +01:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-03-15 21:15:08 +01:00
2025-03-03 22:39:42 +01:00
2025-04-11 15:53:25 +02:00
2025-07-31 13:17:36 +02:00
2025-05-15 11:38:24 +02:00
2025-05-15 11:38:24 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-05-15 11:38:24 +02:00
2025-03-02 13:10:50 +01:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-12-17 23:22:01 +02:00
2025-03-07 18:34:56 +01:00
2025-09-03 09:12:12 -07:00
2025-10-24 16:07:49 -04:00
2025-05-02 10:58:14 +03:00
2025-07-28 17:45:16 +02:00
2025-07-28 17:45:16 +02:00
2025-11-21 16:41:29 -05:00
2025-07-28 16:17:26 +08:00
2025-12-17 23:22:01 +02:00
2025-09-06 11:56:01 -04:00
2025-04-12 13:24:45 +02:00
2025-12-17 23:22:01 +02:00
2025-02-10 10:35:44 -08:00
2025-03-02 13:37:51 +01:00
2025-07-28 17:45:16 +02:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-08-05 00:21:04 +02:00
2025-07-21 16:12:37 -04:00
2025-07-21 16:12:37 -04:00
2025-04-07 11:34:24 -04:00
2025-04-07 11:34:24 -04:00
2025-05-29 11:37:18 +02:00
2025-09-03 09:12:12 -07:00
2025-09-03 09:12:12 -07:00
2026-01-08 14:35:47 +01:00
2025-03-15 21:15:08 +01:00
2025-02-10 10:35:44 -08:00
2025-05-22 00:07:38 -04:00
2025-09-03 09:41:19 -07:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-06-12 08:58:26 +03:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2026-01-05 12:26:49 +00:00
2025-02-10 10:35:44 -08:00
2025-10-29 10:35:20 +00:00
2025-10-29 10:35:20 +00:00
2025-10-29 10:35:20 +00:00
2025-02-10 10:35:44 -08:00
2026-02-10 13:26:03 +00:00
2025-04-30 12:09:20 +03:00
2025-09-20 00:20:32 +03:00
2025-07-25 23:58:56 -07:00
2025-09-06 11:56:01 -04:00
2025-02-10 10:35:44 -08:00
2025-06-13 23:10:30 +02:00
2025-07-28 17:01:26 +02:00
2025-07-25 23:58:56 -07:00
2025-07-25 23:58:56 -07:00
2025-09-09 07:28:24 -04:00
2025-09-08 08:51:00 -04:00
2025-09-09 07:28:24 -04:00
2025-09-09 07:28:24 -04:00
2025-09-04 01:38:46 +00:00
2025-09-09 13:10:28 +03:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-09-04 23:06:38 +03:00
2025-05-29 11:35:16 +02:00
2025-09-25 23:11:17 +03:00
2025-07-22 16:57:20 +01:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-02-10 10:35:44 -08:00
2025-06-24 09:39:11 -07:00
2025-09-09 13:10:28 +03:00
2025-07-25 23:58:56 -07:00
2025-07-25 23:58:56 -07:00