]> git.hungrycats.org Git - linux/commit
build-id: require program headers to be right after ELF header
authorAlexey Dobriyan <adobriyan@gmail.com>
Fri, 21 Jun 2024 18:39:33 +0000 (21:39 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Oct 2024 13:22:05 +0000 (15:22 +0200)
commitfee9e01333aa2ecd19baa39467484f574decd675
treed4fc968a77a38d1a3644ecc8ee831dadb5282ed5
parent5639cd069d479d82e93cc39938ac42a07143b1dc
build-id: require program headers to be right after ELF header

[ Upstream commit 961a2851324561caed579764ffbee3db82b32829 ]

Neither ELF spec not ELF loader require program header to be placed right
after ELF header, but build-id code very much assumes such placement:

See

find_get_page(vma->vm_file->f_mapping, 0);

line and checks against PAGE_SIZE.

Returns errors for now until someone rewrites build-id parser
to be more inline with load_elf_binary().

Link: https://lkml.kernel.org/r/d58bc281-6ca7-467a-9a64-40fa214bd63e@p183
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Reviewed-by: Jiri Olsa <jolsa@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Stable-dep-of: 905415ff3ffb ("lib/buildid: harden build ID parsing logic")
Signed-off-by: Sasha Levin <sashal@kernel.org>
lib/buildid.c