From: Kees Cook Date: Mon, 10 Mar 2014 20:42:48 +0000 (-0700) Subject: x86, kaslr: fix module lock ordering problem X-Git-Tag: v3.15-rc1~170^2 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9dd721c6dbfc310f94306902611f86dda87a45fa;p=pandora-kernel.git x86, kaslr: fix module lock ordering problem There was a potential lock ordering problem with the module kASLR patch ("x86, kaslr: randomize module base load address"). This patch removes the usage of the module_mutex and creates a new mutex to protect the module base address offset value. Chain exists of: text_mutex --> kprobe_insn_slots.mutex --> module_mutex [ 0.515561] Possible unsafe locking scenario: [ 0.515561] [ 0.515561] CPU0 CPU1 [ 0.515561] ---- ---- [ 0.515561] lock(module_mutex); [ 0.515561] lock(kprobe_insn_slots.mutex); [ 0.515561] lock(module_mutex); [ 0.515561] lock(text_mutex); [ 0.515561] [ 0.515561] *** DEADLOCK *** Reported-by: Fengguang Wu Signed-off-by: Andy Honig Signed-off-by: Kees Cook Reviewed-by: Masami Hiramatsu Signed-off-by: H. Peter Anvin --- Reading git-diff-tree failed