Context |
Check |
Description |
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/merge (54dc28ff5e0b3585224d49a31b53e030342ca5c3)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/next (45591da765885f7320a111d290b3a28a23eed359)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch linus/master (6a8b55ed4056ea5559ebe4f6a4b247f627870d4c)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch powerpc/fixes (5990cdee689c6885b27c6d969a3d58b09002b0bc)
|
snowpatch_ozlabs/apply_patch |
warning
|
Failed to apply on branch linux-next (8bdabd09ec86a993419c8c98a4f34c12bc902c6c)
|
snowpatch_ozlabs/apply_patch |
fail
|
Failed to apply to any branch
|
@@ -13,6 +13,7 @@
extern int max_pkey;
extern u64 default_uamor;
+extern u64 default_amr;
extern u32 reserved_allocation_mask; /* bits set for reserved keys */
#define ARCH_VM_PKEY_FLAGS (VM_PKEY_BIT0 | VM_PKEY_BIT1 | VM_PKEY_BIT2 | \
@@ -1473,6 +1473,8 @@ void arch_setup_new_exec(void)
current->thread.regs = regs - 1;
}
+ current->thread.regs->kuap = default_amr;
+ current->thread.regs->kuep = default_iamr;
}
#endif
@@ -1827,7 +1829,6 @@ void start_thread(struct pt_regs *regs, unsigned long start, unsigned long sp)
current->thread.load_tm = 0;
#endif /* CONFIG_PPC_TRANSACTIONAL_MEM */
- thread_pkey_regs_init(¤t->thread);
}
EXPORT_SYMBOL(start_thread);
@@ -20,7 +20,7 @@ int max_pkey; /* Maximum key value supported */
*/
u32 reserved_allocation_mask;
static u32 initial_allocation_mask; /* Bits set for the initially allocated keys */
-static u64 default_amr;
+u64 default_amr;
static u64 default_iamr;
/* Allow all keys to be modified by default */
u64 default_uamor = ~0x0UL;
@@ -387,20 +387,6 @@ void thread_pkey_regs_restore(struct thread_struct *new_thread,
write_uamor(new_thread->uamor);
}
-void thread_pkey_regs_init(struct thread_struct *thread)
-{
- if (!mmu_has_feature(MMU_FTR_PKEY))
- return;
-
- thread->amr = default_amr;
- thread->iamr = default_iamr;
- thread->uamor = default_uamor;
-
- write_amr(default_amr);
- write_iamr(default_iamr);
- write_uamor(default_uamor);
-}
-
int execute_only_pkey(struct mm_struct *mm)
{
if (static_branch_likely(&execute_pkey_disabled))
On fork, we inherit from the parent and on exec, we should switch to default_amr values. Also, avoid changing the AMR register value within the kernel. The kernel now runs with different AMR values. Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@linux.ibm.com> --- arch/powerpc/include/asm/pkeys.h | 1 + arch/powerpc/kernel/process.c | 3 ++- arch/powerpc/mm/book3s64/pkeys.c | 16 +--------------- 3 files changed, 4 insertions(+), 16 deletions(-)