Messages in this thread | | | Date | Tue, 5 Oct 2021 17:21:29 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] ELF: fix overflow in total mapping size calculation |
| |
On Sun, 3 Oct 2021 15:11:24 +0300 Alexey Dobriyan <adobriyan@gmail.com> wrote:
> Kernel assumes that ELF program headers are ordered by mapping address, > but doesn't enforce it. It is possible to make mapping size extremely huge > by simply shuffling first and last PT_LOAD segments. > > As long as PT_LOAD segments do not overlap, it is silly to require > sorting by v_addr anyway because mmap() doesn't care. > > Don't assume PT_LOAD segments are sorted and calculate min and max > addresses correctly.
It sounds good, but why do I have the feeling this will explode in some unexpected fashion? Because it's elf, and that's what it does :(
| |