mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
powerpc: Add barrier_nospec to raw_copy_in_user()
commit6fbcdd5909upstream. Commitddf35cf376("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:ddf35cf376("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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
eb020b77b6
commit
d9e8b4ba03
@@ -306,6 +306,7 @@ extern unsigned long __copy_tofrom_user(void __user *to,
|
||||
static inline unsigned long
|
||||
raw_copy_in_user(void __user *to, const void __user *from, unsigned long n)
|
||||
{
|
||||
barrier_nospec();
|
||||
return __copy_tofrom_user(to, from, n);
|
||||
}
|
||||
#endif /* __powerpc64__ */
|
||||
|
||||
Reference in New Issue
Block a user