]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
mm/pkeys: remove unused tsk parameter from arch_set_user_pkey_access()
authorSeongsu Park <sgsu.park@samsung.com>
Thu, 19 Feb 2026 06:35:06 +0000 (15:35 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sun, 5 Apr 2026 20:52:57 +0000 (13:52 -0700)
The tsk parameter in arch_set_user_pkey_access() is never used in the
function implementations across all architectures (arm64, powerpc, x86).

Link: https://lkml.kernel.org/r/20260219063506.545148-1-sgsu.park@samsung.com
Signed-off-by: Seongsu Park <sgsu.park@samsung.com>
Cc: "Borislav Petkov (AMD)" <bp@alien8.de>
Cc: Catalin Marinas <catalin.marinas@arm.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Liam Howlett <liam.howlett@oracle.com>
Cc: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Cc: Madhavan Srinivasan <maddy@linux.ibm.com>
Cc: Michael Ellerman <mpe@ellerman.id.au>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Will Deacon <will@kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
arch/arm64/include/asm/pkeys.h
arch/arm64/mm/mmu.c
arch/powerpc/include/asm/pkeys.h
arch/powerpc/mm/book3s64/pkeys.c
arch/x86/include/asm/pkeys.h
arch/x86/kernel/fpu/xstate.c
arch/x86/mm/pkeys.c
mm/mprotect.c

index 0ca5f83ce148f59ba00f7eef55463c3b6dba2b45..cd286d3a9c94f2da06bc4da51d115fee2d1e9cbf 100644 (file)
@@ -12,8 +12,7 @@
 
 #define arch_max_pkey() 8
 
-int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-               unsigned long init_val);
+int arch_set_user_pkey_access(int pkey, unsigned long init_val);
 
 static inline bool arch_pkeys_enabled(void)
 {
index a6a00accf4f9380ca17fa3be2aee6abf17009e12..a12ea8776c32977e6f3a284ebf39a9d65fa20e06 100644 (file)
@@ -2206,7 +2206,7 @@ void __cpu_replace_ttbr1(pgd_t *pgdp, bool cnp)
 }
 
 #ifdef CONFIG_ARCH_HAS_PKEYS
-int arch_set_user_pkey_access(struct task_struct *tsk, int pkey, unsigned long init_val)
+int arch_set_user_pkey_access(int pkey, unsigned long init_val)
 {
        u64 new_por;
        u64 old_por;
index 28e752138996e06b52257e70bc86d0648d473d42..bd20d4106471cf03a01d52562a6dfdd1c15ec803 100644 (file)
@@ -143,10 +143,8 @@ static inline int arch_override_mprotect_pkey(struct vm_area_struct *vma,
        return __arch_override_mprotect_pkey(vma, prot, pkey);
 }
 
-extern int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-                                      unsigned long init_val);
-static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-                                           unsigned long init_val)
+extern int __arch_set_user_pkey_access(int pkey, unsigned long init_val);
+static inline int arch_set_user_pkey_access(int pkey, unsigned long init_val)
 {
        if (!mmu_has_feature(MMU_FTR_PKEY))
                return -EINVAL;
@@ -160,7 +158,7 @@ static inline int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
        if (pkey == 0)
                return init_val ? -EINVAL : 0;
 
-       return __arch_set_user_pkey_access(tsk, pkey, init_val);
+       return __arch_set_user_pkey_access(pkey, init_val);
 }
 
 static inline bool arch_pkeys_enabled(void)
index a974baf8f3278e6ae8dd66f98c9665813f8f646d..2002331b05bab2312a797238d684ca6fbbad703f 100644 (file)
@@ -335,8 +335,7 @@ static inline void init_iamr(int pkey, u8 init_bits)
  * Set the access rights in AMR IAMR and UAMOR registers for @pkey to that
  * specified in @init_val.
  */
-int __arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-                               unsigned long init_val)
+int __arch_set_user_pkey_access(int pkey, unsigned long init_val)
 {
        u64 new_amr_bits = 0x0ul;
        u64 new_iamr_bits = 0x0ul;
index 2e6c04d8a45b487868b87c1e75c047cf7b509020..06ed2cd2592e8e3d0ae000307b595dff5a80e848 100644 (file)
@@ -9,8 +9,7 @@
  */
 #define arch_max_pkey() (cpu_feature_enabled(X86_FEATURE_OSPKE) ? 16 : 1)
 
-extern int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-               unsigned long init_val);
+extern int arch_set_user_pkey_access(int pkey, unsigned long init_val);
 
 static inline bool arch_pkeys_enabled(void)
 {
index 76153dfb58c9d03c86883ad0998ee3ccb8b78056..a7b6524a9dea2221bd7cf2f2c557eafd30e1aa29 100644 (file)
@@ -1080,8 +1080,7 @@ void __user *get_xsave_addr_user(struct xregs_state __user *xsave, int xfeature_
  * This will go out and modify PKRU register to set the access
  * rights for @pkey to @init_val.
  */
-int arch_set_user_pkey_access(struct task_struct *tsk, int pkey,
-                             unsigned long init_val)
+int arch_set_user_pkey_access(int pkey, unsigned long init_val)
 {
        u32 old_pkru, new_pkru_bits = 0;
        int pkey_shift;
index 7418c367e3281cfab653b677c21759f2e3afcc8a..1dfcfaf77e23cfa028fec88eeb6416e5bbf46aeb 100644 (file)
@@ -42,8 +42,7 @@ int __execute_only_pkey(struct mm_struct *mm)
         * Set up PKRU so that it denies access for everything
         * other than execution.
         */
-       ret = arch_set_user_pkey_access(current, execute_only_pkey,
-                       PKEY_DISABLE_ACCESS);
+       ret = arch_set_user_pkey_access(execute_only_pkey, PKEY_DISABLE_ACCESS);
        /*
         * If the PKRU-set operation failed somehow, just return
         * 0 and effectively disable execute-only support.
index c0571445bef7fe2f0f4bce5e2483cfe9324c9275..9681f055b9fca8a2ccd1e25b2bfd41ec9e1fd695 100644 (file)
@@ -978,7 +978,7 @@ SYSCALL_DEFINE2(pkey_alloc, unsigned long, flags, unsigned long, init_val)
        if (pkey == -1)
                goto out;
 
-       ret = arch_set_user_pkey_access(current, pkey, init_val);
+       ret = arch_set_user_pkey_access(pkey, init_val);
        if (ret) {
                mm_pkey_free(current->mm, pkey);
                goto out;