mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
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:
@@ -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) {
|
||||
|
Reference in New Issue
Block a user