]> www.infradead.org Git - users/dwmw2/linux.git/commit
x86/static_call: Serialize __static_call_fixup() properly
authorThomas Gleixner <tglx@linutronix.de>
Tue, 12 Jul 2022 12:01:06 +0000 (14:01 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 25 Jul 2022 09:26:51 +0000 (11:26 +0200)
commitc035ca88b0742952150b1671bb5d26b96f921245
treeef3b4183056f4de2b8eeeeac014d8e0f6d8c9c05
parenteb38964b6ff864b8bdf87c9cf6221d0b0611a990
x86/static_call: Serialize __static_call_fixup() properly

commit c27c753ea6fd1237f4f96abf8b623d7bab505513 upstream.

__static_call_fixup() invokes __static_call_transform() without holding
text_mutex, which causes lockdep to complain in text_poke_bp().

Adding the proper locking cures that, but as this is either used during
early boot or during module finalizing, it's not required to use
text_poke_bp(). Add an argument to __static_call_transform() which tells
it to use text_poke_early() for it.

Fixes: ee88d363d156 ("x86,static_call: Use alternative RET encoding")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/x86/kernel/static_call.c