[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220127124014.338760-1-akirakawata1@gmail.com>
Date: Thu, 27 Jan 2022 21:40:14 +0900
From: Akira Kawata <akirakawata1@...il.com>
To: akpm@...ux-foundation.org, adobriyan@...il.com,
viro@...iv.linux.org.uk, keescook@...omium.org,
linux-fsdevel@...r.kernel.org, lukas.bulwahn@...il.com
Cc: akirakawata1@...il.com, Eric Biederman <ebiederm@...ssion.com>,
linux-kernel@...r.kernel.org
Subject: [PATCH v5 0/2] fs/binfmt_elf: Fix AT_PHDR for unusual ELF files
These patches fix a bug in AT_PHDR calculation.
We cannot calculate AT_PHDR as the sum of load_addr and exec->e_phoff.
This is because exec->e_phoff is the offset of PHDRs in the file and the
address of PHDRs in the memory may differ from it. These patches fix the
bug by calculating the address of program headers from PT_LOADs
directly.
Changes in v5
- Reflecting on comments from Kees, add a comment to the first commit.
Changes in v4
- Reflecting on comments from Lukas, add a refactoring commit.
Changes in v3:
- Fix a reported bug from kernel test robot.
Changes in v2:
- Remove unused load_addr from create_elf_tables.
- Improve the commit message.
Akira Kawata (2):
fs/binfmt_elf: Fix AT_PHDR for unusual ELF files
fs/binfmt_elf: Refactor load_elf_binary function
fs/binfmt_elf.c | 40 +++++++++++++++++++++++++---------------
1 file changed, 25 insertions(+), 15 deletions(-)
base-commit: 0eb96e2c58c03e79fc2ee833ba88bf9226986564
--
2.25.1
Powered by blists - more mailing lists