]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib/buildid: take into account e_phoff when fetching program headers
authorAndrii Nakryiko <andrii@kernel.org>
Thu, 29 Aug 2024 17:42:25 +0000 (10:42 -0700)
committerAlexei Starovoitov <ast@kernel.org>
Wed, 11 Sep 2024 16:58:30 +0000 (09:58 -0700)
commitd4deb82423416e3ace7889816eea630af81fe702
tree64ccb9d07086d240b533b8cb633261ccc712ae88
parentde3ec364c3c37971dbba1e37a55ae5b646c6f24e
lib/buildid: take into account e_phoff when fetching program headers

Current code assumption is that program (segment) headers are following
ELF header immediately. This is a common case, but is not guaranteed. So
take into account e_phoff field of the ELF header when accessing program
headers.

Reviewed-by: Eduard Zingerman <eddyz87@gmail.com>
Reported-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20240829174232.3133883-4-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
lib/buildid.c