]> git.ipfire.org Git - thirdparty/kmod.git/commit
libkmod: Avoid OOB with huge ELF files
authorTobias Stoeckmann <tobias@stoeckmann.org>
Mon, 23 Sep 2024 19:22:00 +0000 (21:22 +0200)
committerLucas De Marchi <lucas.de.marchi@gmail.com>
Sat, 28 Sep 2024 04:05:38 +0000 (23:05 -0500)
commita31b8ecd5d81fe4de0cc4d887abce1fdcc05f6c2
treecaae5fa716a52da9fc7b8ae3807a1e97d5baff48
parent9626e135722f97006aed40fe9ef1a770f68d5ba0
libkmod: Avoid OOB with huge ELF files

On 32 bit systems it is possible to trigger an out of boundary write
with excessively huge ELF files.

The calculation of required memory for char pointer vector and strings
might overflow, leading to an allocation which is too small. Subsequent
memcpy leads to an out of boundary write.

Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Link: https://github.com/kmod-project/kmod/pull/149
Signed-off-by: Lucas De Marchi <lucas.de.marchi@gmail.com>
libkmod/libkmod-elf.c