History

arm64: cleanup {COMPAT_,}SET_PERSONALITY() macro

There is some work that should be done after setting the personality. Currently it's done in the macro, which is not the best idea. In this patch new arch_setup_new_exec() routine is introduced, and all setup code is moved there, as suggested by Catalin: https://lkml.org/lkml/2017/8/4/494

Yury Norov committed 9 years ago

Commit d1be5c91 parent 5ce93ab3 files · +11 −2Browse files

Unified · Split

3 files
  1. arch/arm64/include/asm/elf.h +0 −2
  2. arch/arm64/include/asm/thread_info.h +3 −0
  3. arch/arm64/kernel/process.c +8 −0
arch/arm64/include/asm/elf.h+0−2
@@ -139,7 +139,6 @@ typedef struct user_fpsimd_state elf_fpregset_t; · 138 unmodified lines
139139
140140 #define SET_PERSONALITY(ex) \
141141 ({ \
142− current->mm->context.flags = 0; \
143142 clear_thread_flag(TIF_32BIT); \
144143 current->personality &= ~READ_IMPLIES_EXEC; \
145144 })
@@ -195,7 +194,6 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; · 49 unmodified lines
195194 */
196195 #define COMPAT_SET_PERSONALITY(ex) \
197196 ({ \
198− current->mm->context.flags = MMCF_AARCH32; \
199197 set_thread_flag(TIF_32BIT); \
200198 })
201199 #define COMPAT_ARCH_DLINFO
arch/arm64/include/asm/thread_info.h+3−0
@@ -60,6 +60,9 @@ struct thread_info { · 59 unmodified lines
6060 #define thread_saved_fp(tsk) \
6161 ((unsigned long)(tsk->thread.cpu_context.fp))
6262
63+void arch_setup_new_exec(void);
64+#define arch_setup_new_exec arch_setup_new_exec
65+
6366 #endif
6467
6568 /*
arch/arm64/kernel/process.c+8−0
@@ -414,3 +414,11 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) · 413 unmodified lines
414414 else
415415 return randomize_page(mm->brk, SZ_1G);
416416 }
417+
418+/*
419+ * Called from setup_new_exec() after (COMPAT_)SET_PERSONALITY.
420+ */
421+void arch_setup_new_exec(void)
422+{
423+ current->mm->context.flags = is_compat_task() ? MMCF_AARCH32 : 0;
424+}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t