livepatch: fix RCU usage in klp_find_external_symbol()
authorPeter Zijlstra <peterz@infradead.org>
Sat, 28 Feb 2015 21:24:48 +0000 (22:24 +0100)
committerJiri Kosina <jkosina@suse.cz>
Mon, 2 Mar 2015 23:22:55 +0000 (00:22 +0100)
commitc064a0de1bfb07c34a3798822c7e1636eea866e8
treed91896f9a004e5e36809262a85791d6aec85a89e
parentc4ce0da8ec62d83c96e29db7dadd6d3985344bb3
livepatch: fix RCU usage in klp_find_external_symbol()

While one must hold RCU-sched (aka. preempt_disable) for find_symbol()
one must equally hold it over the use of the object returned.

The moment you release the RCU-sched read lock, the object can be dead
and gone.

[jkosina@suse.cz: change subject line to be aligned with other patches]
Cc: Seth Jennings <sjenning@redhat.com>
Cc: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Miroslav Benes <mbenes@suse.cz>
Cc: Petr Mladek <pmladek@suse.cz>
Cc: Jiri Kosina <jkosina@suse.cz>
Cc: "Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Cc: Rusty Russell <rusty@rustcorp.com.au>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Acked-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
kernel/livepatch/core.c