powerpc: Add barrier_nospec to raw_copy_in_user()
authorSuraj Jitindar Singh <sjitindarsingh@gmail.com>
Wed, 6 Mar 2019 01:10:38 +0000 (12:10 +1100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Sep 2019 07:09:35 +0000 (09:09 +0200)
commitd9e8b4ba039766141014e20490d33178c96feb10
tree6a666f469ca304988519734236b20acbfb405844
parenteb020b77b6461be9bfb36aef6e745f1f7084bf66
powerpc: Add barrier_nospec to raw_copy_in_user()

commit 6fbcdd59094ade30db63f32316e9502425d7b256 upstream.

Commit ddf35cf3764b ("powerpc: Use barrier_nospec in copy_from_user()")
Added barrier_nospec before loading from user-controlled pointers. The
intention was to order the load from the potentially user-controlled
pointer vs a previous branch based on an access_ok() check or similar.

In order to achieve the same result, add a barrier_nospec to the
raw_copy_in_user() function before loading from such a user-controlled
pointer.

Fixes: ddf35cf3764b ("powerpc: Use barrier_nospec in copy_from_user()")
Signed-off-by: Suraj Jitindar Singh <sjitindarsingh@gmail.com>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/powerpc/include/asm/uaccess.h