t30002884 427e4261f4 [PATCH] Check the validity of len before mmap
Two cases:
(1)If condition 'c->mapend + extra_len < c->mapstart + relro_len' is True, the result of "len" (size_t len = (c->mapend + extra_len) - (c->mapstart + relro_len)) will be a negative value. 'len' is of type size_t, so it overflows. later __mmap will fail, because 'len - mod' is a very large value at this point.

(2)If the data segment is small, "len" may be equal to 0. In this case, __mmap also fails.

In both cases, the mapping fails, the mapping is falled back, and hugepage feature of dynamic library becomes invalid. Case (1) is an exception, and the fallback is the expected. Case (2) should not be fallled back in its entirety. In this case, the code segment may continue to use huge page, and the data segment uses 4KB page.
2024-07-15 10:43:36 +08:00
2023-10-09 11:15:49 +08:00
2023-09-27 10:59:22 +08:00
2019-09-30 10:40:45 -04:00
2021-08-06 17:32:15 +08:00
2022-05-05 19:31:28 +08:00
2019-12-14 14:32:18 +08:00
2020-07-06 09:03:03 +08:00
2019-09-30 10:40:45 -04:00
2022-05-05 19:31:28 +08:00
2019-09-30 10:40:45 -04:00
Description
No description provided
101 MiB
Languages
Shell 39%
Python 31.2%
Makefile 29.8%