Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-16 Thread Nicholas Piggin
Excerpts from Jessica Yu's message of June 16, 2021 10:54 pm: > +++ Nicholas Piggin [16/06/21 11:18 +1000]: >>Excerpts from Jessica Yu's message of June 15, 2021 10:17 pm: >>> +++ Nicholas Piggin [15/06/21 12:05 +1000]: Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: > +++ Nic

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-16 Thread Jessica Yu
+++ Michael Ellerman [16/06/21 12:37 +1000]: Jessica Yu writes: +++ Nicholas Piggin [15/06/21 12:05 +1000]: Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but kernel mo

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-16 Thread Jessica Yu
+++ Nicholas Piggin [16/06/21 11:18 +1000]: Excerpts from Jessica Yu's message of June 15, 2021 10:17 pm: +++ Nicholas Piggin [15/06/21 12:05 +1000]: Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Michael Ellerman
Segher Boessenkool writes: > On Tue, Jun 15, 2021 at 03:41:00PM +0200, Jessica Yu wrote: >> +++ Segher Boessenkool [15/06/21 07:50 -0500]: >> >On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: >> >>+int __weak elf_check_module_arch(Elf_Ehdr *hdr) >> >>+{ >> >>+ return 1; >> >>+} >>

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Michael Ellerman
Jessica Yu writes: > +++ Nicholas Piggin [15/06/21 12:05 +1000]: >>Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: >>> +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but kernel modules may have more specific requir

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Nicholas Piggin
Excerpts from Jessica Yu's message of June 15, 2021 10:17 pm: > +++ Nicholas Piggin [15/06/21 12:05 +1000]: >>Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: >>> +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but ke

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Segher Boessenkool
On Tue, Jun 15, 2021 at 03:41:00PM +0200, Jessica Yu wrote: > +++ Segher Boessenkool [15/06/21 07:50 -0500]: > >On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: > >>+int __weak elf_check_module_arch(Elf_Ehdr *hdr) > >>+{ > >>+ return 1; > >>+} > > > >But is this a good idea? It is

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Jessica Yu
+++ Segher Boessenkool [15/06/21 07:50 -0500]: On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: +int __weak elf_check_module_arch(Elf_Ehdr *hdr) +{ + return 1; +} But is this a good idea? It isn't useful to be able to attempt to load a module not compiled for your architectur

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Segher Boessenkool
On Tue, Jun 15, 2021 at 02:17:40PM +0200, Jessica Yu wrote: > +int __weak elf_check_module_arch(Elf_Ehdr *hdr) > +{ > + return 1; > +} But is this a good idea? It isn't useful to be able to attempt to load a module not compiled for your architecture, and it increases the attack surface trem

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-15 Thread Jessica Yu
+++ Nicholas Piggin [15/06/21 12:05 +1000]: Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: +++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but kernel modules may have more specific requirements. powerpc would like to te

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-14 Thread Nicholas Piggin
Excerpts from Jessica Yu's message of June 14, 2021 10:06 pm: > +++ Nicholas Piggin [11/06/21 19:39 +1000]: >>The elf_check_arch() function is used to test usermode binaries, but >>kernel modules may have more specific requirements. powerpc would like >>to test for ABI version compatibility. >> >>A

Re: [PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-14 Thread Jessica Yu
+++ Nicholas Piggin [11/06/21 19:39 +1000]: The elf_check_arch() function is used to test usermode binaries, but kernel modules may have more specific requirements. powerpc would like to test for ABI version compatibility. Add an arch-overridable function elf_check_module_arch() that defaults to

[PATCH v4 1/2] module: add elf_check_module_arch for module specific elf arch checks

2021-06-11 Thread Nicholas Piggin
The elf_check_arch() function is used to test usermode binaries, but kernel modules may have more specific requirements. powerpc would like to test for ABI version compatibility. Add an arch-overridable function elf_check_module_arch() that defaults to elf_check_arch() and use it in elf_validity_c