#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)
{
}
#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;
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;
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)
* 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;
*/
#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)
{
* 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;
* 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.
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;