]> www.infradead.org Git - users/jedix/linux-maple.git/commit
retpoline: move lock/unlock of spec_ctrl_mutex to check_modinfo()
authorChuck Anderson <chuck.anderson@oracle.com>
Mon, 26 Feb 2018 08:59:51 +0000 (00:59 -0800)
committerChuck Anderson <chuck.anderson@oracle.com>
Sat, 3 Mar 2018 01:58:37 +0000 (17:58 -0800)
commit8a49dfb41eb96ffa82c6c72664ed29ad5a74e2b3
tree5f262f4a30a9bcf2ade031b8c5388bcab5eb7b1c
parentb55b55d9ac522393e49178704d80a4df73f0b3cd
retpoline: move lock/unlock of spec_ctrl_mutex to check_modinfo()

Testing has found that check_modinfo() will call disable_retpoline()
concurrently for the same module.  Serialization through
spec_ctrl_mutex in disable_retpoline() keeps the retpoline state sane
but misleading messages are issued during the duplicate call.
Move the lock/unlock of spec_ctrl_mutex to check_modinfo() so that the
first call to disable_retpoline() will disable retpoline before the
duplicate call checks to see if retpoline is disabled.

Orabug: 27625404
Signed-off-by: Chuck Anderson <chuck.anderson@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
arch/x86/kernel/cpu/bugs_64.c
kernel/module.c