linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/3] Module load failure race fix.
@ 2015-01-08  0:58 Rusty Russell
  2015-01-08  0:58 ` [PATCH 1/3] module_arch_freeing_init(): new hook for archs before module->module_init freed Rusty Russell
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rusty Russell @ 2015-01-08  0:58 UTC (permalink / raw)
  To: linux-kernel; +Cc: Rusty Russell

Hi all,

	This bug has been around since 2009, but only reported now.
I'm debating whether to cc: stable.

To fix it, I had to change module_free.  Please ensure I haven't broken
your arch!

Thanks,
Rusty.

Rusty Russell (3):
  module_arch_freeing_init(): new hook for archs before
    module->module_init freed.
  module: remove mod arg from module_free, rename module_memfree().
  module: fix race in kallsyms resolution during module load success.

 arch/avr32/kernel/module.c      | 13 +-------
 arch/cris/kernel/module.c       |  2 +-
 arch/ia64/kernel/module.c       |  6 ++--
 arch/mips/net/bpf_jit.c         |  2 +-
 arch/nios2/kernel/module.c      |  2 +-
 arch/parisc/kernel/module.c     |  6 +---
 arch/powerpc/net/bpf_jit_comp.c |  2 +-
 arch/s390/kernel/module.c       | 10 ++----
 arch/sparc/net/bpf_jit_comp.c   |  4 +--
 arch/tile/kernel/module.c       |  4 +--
 arch/x86/kernel/ftrace.c        |  2 +-
 include/linux/moduleloader.h    |  4 ++-
 kernel/bpf/core.c               |  2 +-
 kernel/kprobes.c                |  2 +-
 kernel/module.c                 | 74 ++++++++++++++++++++++++++++++-----------
 15 files changed, 76 insertions(+), 59 deletions(-)

-- 
2.1.0


^ permalink raw reply	[flat|nested] 7+ messages in thread
* Re: [PATCH 2/3] module: remove mod arg from module_free, rename module_memfree().
@ 2015-01-08  1:17 Alexei Starovoitov
  0 siblings, 0 replies; 7+ messages in thread
From: Alexei Starovoitov @ 2015-01-08  1:17 UTC (permalink / raw)
  To: Rusty Russell
  Cc: linux-kernel@vger.kernel.org, Mikael Starvik, Jesper Nilsson,
	Ralf Baechle, Ley Foon Tan, Benjamin Herrenschmidt, Chris Metcalf,
	Steven Rostedt, x86@kernel.org, Alexei Starovoitov,
	Ananth N Mavinakayanahalli, Anil S Keshavamurthy,
	Masami Hiramatsu, linux-cris-kernel, linux-mips, nios2-dev,
	linuxppc-dev, sparclinux, netdev@vger.kernel.org

On Wed, Jan 7, 2015 at 4:58 PM, Rusty Russell <rusty@rustcorp.com.au> wrote:
> --- a/kernel/bpf/core.c
> +++ b/kernel/bpf/core.c
>  void bpf_jit_binary_free(struct bpf_binary_header *hdr)
>  {
> -       module_free(NULL, hdr);
> +       module_memfree(hdr);
>  }
...
> -void __weak module_free(struct module *mod, void *module_region)
> +void __weak module_memfree(void *module_region)
>  {
>         vfree(module_region);
>  }

Looks obviously correct.
Acked-by: Alexei Starovoitov <ast@kernel.org>

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-01-13 21:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-08  0:58 [PATCH 0/3] Module load failure race fix Rusty Russell
2015-01-08  0:58 ` [PATCH 1/3] module_arch_freeing_init(): new hook for archs before module->module_init freed Rusty Russell
2015-01-08  7:55   ` Hans-Christian Egtvedt
2015-01-13 21:11   ` Helge Deller
2015-01-08  0:58 ` [PATCH 2/3] module: remove mod arg from module_free, rename module_memfree() Rusty Russell
2015-01-08  0:58 ` [PATCH 3/3] module: fix race in kallsyms resolution during module load success Rusty Russell
  -- strict thread matches above, loose matches on Subject: below --
2015-01-08  1:17 [PATCH 2/3] module: remove mod arg from module_free, rename module_memfree() Alexei Starovoitov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).