Re: [PATCH v2 1/2] modutils: check ELF header before calling finit_module()

2021-01-05 Thread Qu Wenruo
On 2021/1/5 上午10:47, Kang-Che Sung wrote: On Mon, Jan 4, 2021 at 6:32 PM Qu Wenruo wrote: On 2021/1/4 下午6:01, Kang-Che Sung wrote: On Sun, Jan 3, 2021 at 12:11 PM Qu Wenruo wrote: finit_module() and init_module() system calls have clear specification to only accept valid ELF image

Re: [PATCH v2 1/2] modutils: check ELF header before calling finit_module()

2021-01-04 Thread Qu Wenruo
On 2021/1/4 下午6:01, Kang-Che Sung wrote: On Sun, Jan 3, 2021 at 12:11 PM Qu Wenruo wrote: finit_module() and init_module() system calls have clear specification to only accept valid ELF image. Although we try finit_module() on compressed modules to let the kernel determine if it's an ELF

[PATCH v2 1/2] modutils: check ELF header before calling finit_module()

2021-01-03 Thread Qu Wenruo
/memory is passed in. Treat the kernel better by just doing a very basic ELF header check before calling finit_module(). Signed-off-by: Qu Wenruo --- modutils/modutils.c | 37 - 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/modutils/modutils.c b

[PATCH v2 2/2] modprobe-small: check ELF header before calling finit_module()

2021-01-03 Thread Qu Wenruo
/memory is passed in. Treat the kernel better by just doing a very basic ELF header check before calling finit_module(). Signed-off-by: Qu Wenruo --- modutils/modprobe-small.c | 33 - 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/modutils/modprobe

[PATCH v2 0/2] Do extra ELF header check before calling finit_module()

2021-01-03 Thread Qu Wenruo
ever a bad thing. Changelog: v2: - Fix the unreleased fd in the modutils.c - Add extra #ifdef to avoid compiling the check if finit_module() is no avaiable - Add the 2nd patch to handle modprobe-small Qu Wenruo (2): modutils: check ELF header before calling finit_module() modprobe-small:

[PATCH v2 0/2] Do extra ELF header check before calling finit_module()

2021-01-03 Thread Qu Wenruo
ever a bad thing. Changelog: v2: - Fix the unreleased fd in the modutils.c - Add extra #ifdef to avoid compiling the check if finit_module() is no avaiable - Add the 2nd patch to handle modprobe-small Qu Wenruo (2): modutils: check ELF header before calling finit_module() modprobe-small: