binfmt_elf fix for v5.17-rc7
- Fix ia64 ET_EXEC loading -----BEGIN PGP SIGNATURE----- iQJKBAABCgA0FiEEpcP2jyKd1g9yPm4TiXL039xtwCYFAmIeZoEWHGtlZXNjb29r QGNocm9taXVtLm9yZwAKCRCJcvTf3G3AJhinD/4mOyZ8VaCYblv9Jh/RaYOK/cjh LfiIkXPr+FiieTB1OJztd7gp9wbxfL3YhhfYGMf+309cio3qvosWpINVYpy3HzdF PYvuW0TBASCNPhFebqRXS955wkbWeiyp4ED/1wEi/i5oA+zX/HGe6/YRn7uveFp7 nZqBKNBwJG14QjqX/drNEUgTgAgIbcIlt48heMxfe/imD98QCLR46X9gL48kM2Fz plKHcIqqg3zOWXvs0RqitaChYqoQ7wgWoWTlk8drjIGKVaMieLY/ZSEvSNmxPhW3 /hjfvpT/DiLXssomVo8qWlcl/IyqixvhhKayCsrMAwpzb+9FwtmRGX3jqYrScWPx OJzX8IdHxkij0lUMYavZK7Ed5i0rXMFEttRbTbwxJxWc8jXIBdyWbIAw2vbM21So 6PQw5OlCwTZhcCS1ZPNYB2jLmhHIs6mFGPcweAVMLcEIEG1nPkkgkO3zQLEcjmH7 eujWR9tYGKokE1qUbj+k/alyNxV9c1DmjrE9OVph+PWA7oj8PvlL2qtV6Uj7iLF7 ps255EsyW8pNTA2315TQpIukba0LMQ2bgWi+2mpMU9FMnQvYfm1JIwr0YV7EvFAk Kkd5U9tu345O/R2uIUhNhwnxb+clCDLKoA5rZ+RnMBHc5O2iDA8nTUewPbmpZQWk StVSktb4TpqUPDOtpQ== =3ZcP -----END PGP SIGNATURE----- Merge tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux Pull binfmt_elf fix from Kees Cook: "This addresses a regression[1] under ia64 where some ET_EXEC binaries were not loading" Link: https://linux-regtracking.leemhuis.info/regzbot/regression/a3edd529-c42d-3b09-135c-7e98a15b150f@leemhuis.info/ [1] - Fix ia64 ET_EXEC loading * tag 'binfmt_elf-v5.17-rc7' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux: binfmt_elf: Avoid total_mapping_size for ET_EXEC
This commit is contained in:
commit
5751153606
@ -1135,14 +1135,25 @@ out_free_interp:
|
||||
* is then page aligned.
|
||||
*/
|
||||
load_bias = ELF_PAGESTART(load_bias - vaddr);
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the entire size of the ELF mapping (total_size).
|
||||
* (Note that load_addr_set is set to true later once the
|
||||
* initial mapping is performed.)
|
||||
*/
|
||||
if (!load_addr_set) {
|
||||
/*
|
||||
* Calculate the entire size of the ELF mapping
|
||||
* (total_size), used for the initial mapping,
|
||||
* due to load_addr_set which is set to true later
|
||||
* once the initial mapping is performed.
|
||||
*
|
||||
* Note that this is only sensible when the LOAD
|
||||
* segments are contiguous (or overlapping). If
|
||||
* used for LOADs that are far apart, this would
|
||||
* cause the holes between LOADs to be mapped,
|
||||
* running the risk of having the mapping fail,
|
||||
* as it would be larger than the ELF file itself.
|
||||
*
|
||||
* As a result, only ET_DYN does this, since
|
||||
* some ET_EXEC (e.g. ia64) may have large virtual
|
||||
* memory holes between LOADs.
|
||||
*
|
||||
*/
|
||||
total_size = total_mapping_size(elf_phdata,
|
||||
elf_ex->e_phnum);
|
||||
if (!total_size) {
|
||||
|
Loading…
Reference in New Issue
Block a user