Bug 197921
Summary: | Wrongly calculate AT_PHDR for ELF auxiliary vectors | ||
---|---|---|---|
Product: | Other | Reporter: | netfirewall |
Component: | Other | Assignee: | other_other |
Status: | NEW --- | ||
Severity: | normal | CC: | a.kawashiro, xiangzhex |
Priority: | P1 | ||
Hardware: | All | ||
OS: | Linux | ||
Kernel Version: | 4.13.0 | Subsystem: | |
Regression: | No | Bisected commit-id: | |
Attachments: | Example ELF with abnormal proram header offset |
Description
netfirewall
2017-11-19 16:24:06 UTC
Created attachment 260719 [details]
Example ELF with abnormal proram header offset
I move the program header of this ELF to file offset 0x1040, which will be mapped to 0x601040. But AT_PHDR will be 0x401040, which is wrong.
I got the same problem. It seems that the issue still exists in the kernel. I am now trying to make a patch to fix this issue and I think there are two problems around AT_PHDR. The first one is the current kernel use `exec->e_phoff` as the offset for program headers as discussed in this issue. The second one is it calculates `load_addr` from the first program header. This should be the minimum value for all program headers as discussed in https://bugs.launchpad.net/qemu/+bug/1885332. |