This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
[Bug runtime/19644] New: linux 4.5-rc4 commit 8244062ef1
- From: "dsmith at redhat dot com" <sourceware-bugzilla at sourceware dot org>
- To: systemtap at sourceware dot org
- Date: Tue, 16 Feb 2016 16:09:18 +0000
- Subject: [Bug runtime/19644] New: linux 4.5-rc4 commit 8244062ef1
- Auto-submitted: auto-generated
https://sourceware.org/bugzilla/show_bug.cgi?id=19644
Bug ID: 19644
Summary: linux 4.5-rc4 commit 8244062ef1
Product: systemtap
Version: unspecified
Status: NEW
Severity: normal
Priority: P2
Component: runtime
Assignee: systemtap at sourceware dot org
Reporter: dsmith at redhat dot com
Target Milestone: ---
Linux kernel commit 8244062ef1 removes the 'symtab' member of 'struct module',
causing errors like this on rawhide kernel 4.5.0-0.rc3.git3.1.fc24.x86_64:
====
/usr/local/share/systemtap/runtime/transport/symbols.c:252:44: error: 'struct
module' has no member named 'symtab'; did you mean 'syms'?
if (attr->address == (unsigned long) mod->symtab)
====
Here's the commit:
====
commit 8244062ef1e54502ef55f54cced659913f244c3e
Author: Rusty Russell <rusty@rustcorp.com.au>
Date: Wed Feb 3 16:55:26 2016 +1030
modules: fix longstanding /proc/kallsyms vs module insertion race.
For CONFIG_KALLSYMS, we keep two symbol tables and two string tables.
There's one full copy, marked SHF_ALLOC and laid out at the end of the
module's init section. There's also a cut-down version that only
contains core symbols and strings, and lives in the module's core
section.
After module init (and before we free the module memory), we switch
the mod->symtab, mod->num_symtab and mod->strtab to point to the core
versions. We do this under the module_mutex.
However, kallsyms doesn't take the module_mutex: it uses
preempt_disable() and rcu tricks to walk through the modules, because
it's used in the oops path. It's also used in /proc/kallsyms.
There's nothing atomic about the change of these variables, so we can
get the old (larger!) num_symtab and the new symtab pointer; in fact
this is what I saw when trying to reproduce.
By grouping these variables together, we can use a
carefully-dereferenced pointer to ensure we always get one or the
other (the free of the module init section is already done in an RCU
callback, so that's safe). We allocate the init one at the end of the
module init section, and keep the core one inside the struct module
itself (it could also have been allocated at the end of the module
core, but that's probably overkill).
====
The runtime will need to be updated to handle this change.
--
You are receiving this mail because:
You are the assignee for the bug.