tipc: fix using smp_processor_id() in preemptible
authorTuong Lien <tuong.t.lien@dektech.com.au>
Sat, 29 Aug 2020 19:37:55 +0000 (02:37 +0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 12 Sep 2020 12:22:14 +0000 (14:22 +0200)
commit6f0e276cda3e452d634b05070fd23a5ef7e6d0a4
tree8077278629bcfc06d1b45f78cd93c2e372f034d2
parentaae250a268933d6eb4a7454e96abeb9c9a85fc04
tipc: fix using smp_processor_id() in preemptible

[ Upstream commit bb8872a1e6bc911869a729240781076ed950764b ]

The 'this_cpu_ptr()' is used to obtain the AEAD key' TFM on the current
CPU for encryption, however the execution can be preemptible since it's
actually user-space context, so the 'using smp_processor_id() in
preemptible' has been observed.

We fix the issue by using the 'get/put_cpu_ptr()' API which consists of
a 'preempt_disable()' instead.

Fixes: fc1b6d6de220 ("tipc: introduce TIPC encryption & authentication")
Acked-by: Jon Maloy <jmaloy@redhat.com>
Signed-off-by: Tuong Lien <tuong.t.lien@dektech.com.au>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/tipc/crypto.c