]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 31 Aug 2020 02:12:17 +0000 (19:12 -0700)
commite3be04f7381c1a08250e24c8f3d0eb3dc64565fc
tree756ac8e2ce412fae24aeedb018ee8ba5871d22c0
parent21dabf928cdccb6ae2b2659ddb35493b34e79b18
tipc: fix using smp_processor_id() in preemptible

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: 4411f05d4f8c ("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>
net/tipc/crypto.c