]> git.baikalelectronics.ru Git - kernel.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)
committerBorislav Petkov <bp@suse.de>
Tue, 12 Jul 2022 12:23:32 +0000 (14:23 +0200)
commit17d60c35ad197dc2c1b4c2b7be73d69e7dc2a601
treea4d18070f91417e41f85c3f4fb1906f4acce0893
parent3b1385b851045842a27b3a3a742fe330e52cba63
x86/static_call: Serialize __static_call_fixup() properly

__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: 71b7c3bdd606 ("x86,static_call: Use alternative RET encoding")
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Borislav Petkov <bp@suse.de>
arch/x86/kernel/static_call.c