]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
powerpc/uaccess: Remove unused size and from parameters from allow_access_user()
authorChristophe Leroy <christophe.leroy@csgroup.eu>
Wed, 24 Dec 2025 11:20:50 +0000 (12:20 +0100)
committerMadhavan Srinivasan <maddy@linux.ibm.com>
Wed, 7 Jan 2026 04:01:04 +0000 (09:31 +0530)
Since commit 16132529cee5 ("powerpc/32s: Rework Kernel Userspace
Access Protection") the size parameter is unused on all platforms.

And the 'from' parameter has never been used.

Remove them.

Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com>
Link: https://patch.msgid.link/4552b00707923b71150ee47b925d6eaae1b03261.1766574657.git.chleroy@kernel.org
arch/powerpc/include/asm/book3s/32/kup.h
arch/powerpc/include/asm/book3s/64/kup.h
arch/powerpc/include/asm/kup.h
arch/powerpc/include/asm/nohash/32/kup-8xx.h
arch/powerpc/include/asm/nohash/kup-booke.h

index 873c5146e32610c528b4b9ede4a98e0bc3dd15c8..a3558419c41b19986cb077d7e68a28308655fe81 100644 (file)
@@ -97,8 +97,7 @@ static __always_inline unsigned long __kuap_get_and_assert_locked(void)
 }
 #define __kuap_get_and_assert_locked __kuap_get_and_assert_locked
 
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             u32 size, unsigned long dir)
+static __always_inline void allow_user_access(void __user *to, unsigned long dir)
 {
        BUILD_BUG_ON(!__builtin_constant_p(dir));
 
index 03aec3c6c851c198b9a8c7c0c7ef770e5902ee76..9ccf8a5e0926f11628d838c5438d0192726b18fc 100644 (file)
@@ -353,8 +353,7 @@ __bad_kuap_fault(struct pt_regs *regs, unsigned long address, bool is_write)
        return (regs->amr & AMR_KUAP_BLOCK_READ) == AMR_KUAP_BLOCK_READ;
 }
 
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             unsigned long size, unsigned long dir)
+static __always_inline void allow_user_access(void __user *to, unsigned long dir)
 {
        unsigned long thread_amr = 0;
 
@@ -383,8 +382,7 @@ static __always_inline unsigned long get_kuap(void)
 
 static __always_inline void set_kuap(unsigned long value) { }
 
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             unsigned long size, unsigned long dir)
+static __always_inline void allow_user_access(void __user *to, unsigned long dir)
 { }
 
 #endif /* !CONFIG_PPC_KUAP */
index f2009d7c8cfa7561526f2d0eac39233fb6f0674a..3963584ac1cf174b31ea26975167aba3b7c876aa 100644 (file)
@@ -72,8 +72,7 @@ static __always_inline void __kuap_kernel_restore(struct pt_regs *regs, unsigned
  * platforms.
  */
 #ifndef CONFIG_PPC_BOOK3S_64
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             unsigned long size, unsigned long dir) { }
+static __always_inline void allow_user_access(void __user *to, unsigned long dir) { }
 static __always_inline void prevent_user_access(unsigned long dir) { }
 static __always_inline unsigned long prevent_user_access_return(void) { return 0UL; }
 static __always_inline void restore_user_access(unsigned long flags) { }
@@ -134,18 +133,18 @@ static __always_inline void kuap_assert_locked(void)
 
 static __always_inline void allow_read_from_user(const void __user *from, unsigned long size)
 {
-       allow_user_access(NULL, from, size, KUAP_READ);
+       allow_user_access(NULL, KUAP_READ);
 }
 
 static __always_inline void allow_write_to_user(void __user *to, unsigned long size)
 {
-       allow_user_access(to, NULL, size, KUAP_WRITE);
+       allow_user_access(to, KUAP_WRITE);
 }
 
 static __always_inline void allow_read_write_user(void __user *to, const void __user *from,
                                                  unsigned long size)
 {
-       allow_user_access(to, from, size, KUAP_READ_WRITE);
+       allow_user_access(to, KUAP_READ_WRITE);
 }
 
 static __always_inline void prevent_read_from_user(const void __user *from, unsigned long size)
index 08486b15b20751bff8c4499afd7f0f10f4ebcc76..efffb5006d190195e86989b1252ecec47fe5248c 100644 (file)
@@ -49,8 +49,7 @@ static __always_inline void uaccess_end_8xx(void)
            "i"(SPRN_MD_AP), "r"(MD_APG_KUAP), "i"(MMU_FTR_KUAP) : "memory");
 }
 
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             unsigned long size, unsigned long dir)
+static __always_inline void allow_user_access(void __user *to, unsigned long dir)
 {
        uaccess_begin_8xx(MD_APG_INIT);
 }
index d6bbb6d78bbe43a8a65108de5b8ca8f44555fd17..cb2d5a96c3df7edc41f8d809ef087c2536c76d39 100644 (file)
@@ -73,8 +73,7 @@ static __always_inline void uaccess_end_booke(void)
            "i"(SPRN_PID), "r"(0), "i"(MMU_FTR_KUAP) : "memory");
 }
 
-static __always_inline void allow_user_access(void __user *to, const void __user *from,
-                                             unsigned long size, unsigned long dir)
+static __always_inline void allow_user_access(void __user *to, unsigned long dir)
 {
        uaccess_begin_booke(current->thread.pid);
 }