Commit cb2f1fb2 authored by Christophe Leroy's avatar Christophe Leroy Committed by Michael Ellerman

powerpc/kuap: Remove to/from/size parameters of prevent_user_access()

prevent_user_access() doesn't use anymore to/from/size parameters.

Remove them.
Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/b7113662fd2c26e4c33e9d705de324bd3860822e.1622708530.git.christophe.leroy@csgroup.eu
parent d008f8f8
...@@ -153,8 +153,7 @@ static __always_inline void allow_user_access(void __user *to, const void __user ...@@ -153,8 +153,7 @@ static __always_inline void allow_user_access(void __user *to, const void __user
kuap_unlock_one((__force u32)to); kuap_unlock_one((__force u32)to);
} }
static __always_inline void prevent_user_access(void __user *to, const void __user *from, static __always_inline void prevent_user_access(unsigned long dir)
u32 size, unsigned long dir)
{ {
u32 kuap = current->thread.kuap; u32 kuap = current->thread.kuap;
......
...@@ -398,8 +398,7 @@ static __always_inline void allow_user_access(void __user *to, const void __user ...@@ -398,8 +398,7 @@ static __always_inline void allow_user_access(void __user *to, const void __user
#endif /* !CONFIG_PPC_KUAP */ #endif /* !CONFIG_PPC_KUAP */
static inline void prevent_user_access(void __user *to, const void __user *from, static inline void prevent_user_access(unsigned long dir)
unsigned long size, unsigned long dir)
{ {
set_kuap(AMR_KUAP_BLOCKED); set_kuap(AMR_KUAP_BLOCKED);
if (static_branch_unlikely(&uaccess_flush_key)) if (static_branch_unlikely(&uaccess_flush_key))
......
...@@ -72,8 +72,7 @@ static inline unsigned long kuap_get_and_assert_locked(void) ...@@ -72,8 +72,7 @@ static inline unsigned long kuap_get_and_assert_locked(void)
#ifndef CONFIG_PPC_BOOK3S_64 #ifndef CONFIG_PPC_BOOK3S_64
static inline void allow_user_access(void __user *to, const void __user *from, static inline void allow_user_access(void __user *to, const void __user *from,
unsigned long size, unsigned long dir) { } unsigned long size, unsigned long dir) { }
static inline void prevent_user_access(void __user *to, const void __user *from, static inline void prevent_user_access(unsigned long dir) { }
unsigned long size, unsigned long dir) { }
static inline unsigned long prevent_user_access_return(void) { return 0UL; } static inline unsigned long prevent_user_access_return(void) { return 0UL; }
static inline void restore_user_access(unsigned long flags) { } static inline void restore_user_access(unsigned long flags) { }
#endif /* CONFIG_PPC_BOOK3S_64 */ #endif /* CONFIG_PPC_BOOK3S_64 */
...@@ -105,33 +104,33 @@ static inline void allow_read_write_user(void __user *to, const void __user *fro ...@@ -105,33 +104,33 @@ static inline void allow_read_write_user(void __user *to, const void __user *fro
static inline void prevent_read_from_user(const void __user *from, unsigned long size) static inline void prevent_read_from_user(const void __user *from, unsigned long size)
{ {
prevent_user_access(NULL, from, size, KUAP_READ); prevent_user_access(KUAP_READ);
} }
static inline void prevent_write_to_user(void __user *to, unsigned long size) static inline void prevent_write_to_user(void __user *to, unsigned long size)
{ {
prevent_user_access(to, NULL, size, KUAP_WRITE); prevent_user_access(KUAP_WRITE);
} }
static inline void prevent_read_write_user(void __user *to, const void __user *from, static inline void prevent_read_write_user(void __user *to, const void __user *from,
unsigned long size) unsigned long size)
{ {
prevent_user_access(to, from, size, KUAP_READ_WRITE); prevent_user_access(KUAP_READ_WRITE);
} }
static inline void prevent_current_access_user(void) static inline void prevent_current_access_user(void)
{ {
prevent_user_access(NULL, NULL, ~0UL, KUAP_READ_WRITE); prevent_user_access(KUAP_READ_WRITE);
} }
static inline void prevent_current_read_from_user(void) static inline void prevent_current_read_from_user(void)
{ {
prevent_user_access(NULL, NULL, ~0UL, KUAP_READ); prevent_user_access(KUAP_READ);
} }
static inline void prevent_current_write_to_user(void) static inline void prevent_current_write_to_user(void)
{ {
prevent_user_access(NULL, NULL, ~0UL, KUAP_WRITE); prevent_user_access(KUAP_WRITE);
} }
#endif /* !__ASSEMBLY__ */ #endif /* !__ASSEMBLY__ */
......
...@@ -71,8 +71,7 @@ static inline void allow_user_access(void __user *to, const void __user *from, ...@@ -71,8 +71,7 @@ static inline void allow_user_access(void __user *to, const void __user *from,
mtspr(SPRN_MD_AP, MD_APG_INIT); mtspr(SPRN_MD_AP, MD_APG_INIT);
} }
static inline void prevent_user_access(void __user *to, const void __user *from, static inline void prevent_user_access(unsigned long dir)
unsigned long size, unsigned long dir)
{ {
if (kuap_is_disabled()) if (kuap_is_disabled())
return; return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment