lkml.org 
[lkml]   [2016]   [Feb]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH v4 2/6] module: preserve Elf information for livepatch modules
On Tue, 9 Feb 2016, Petr Mladek wrote:

> > +#ifdef CONFIG_KALLSYMS
> > + /* Make symtab and strtab available prior to module init call */
> > + mod->num_symtab = mod->core_num_syms;
> > + mod->symtab = mod->core_symtab;
> > + mod->strtab = mod->core_strtab;
> > +#endif
>
> This should be done with module_mutex. Otherwise, it looks racy at least
> against module_kallsyms_on_each_symbol().

Hmm, if this is the case, the comment describing the locking rules for
module_mutex should be updated.

> BTW: I wonder why even the original code is not racy for example against
> module_get_kallsym. It is called without the mutex. This code sets the
> number of entries before the pointer to the entries.
>
> Note that the module is in the list even in the UNFORMED state.

module_kallsyms_on_each_symbol() gives up in such case though.

--
Jiri Kosina
SUSE Labs

\
 
 \ /
  Last update: 2016-02-09 12:01    [W:0.286 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site