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
139 139
140#define SET_PERSONALITY(ex) \140#define SET_PERSONALITY(ex) \
141({ \141({ \
142 current->mm->context.flags = 0; \
143 clear_thread_flag(TIF_32BIT); \142 clear_thread_flag(TIF_32BIT); \
144 current->personality &= ~READ_IMPLIES_EXEC; \143 current->personality &= ~READ_IMPLIES_EXEC; \
145})144})
@@ -195,7 +194,6 @@ typedef compat_elf_greg_t compat_elf_gregset_t[COMPAT_ELF_NGREG]; · 49 unmodified lines
195 */194 */
196#define COMPAT_SET_PERSONALITY(ex) \195#define COMPAT_SET_PERSONALITY(ex) \
197({ \196({ \
198 current->mm->context.flags = MMCF_AARCH32; \
199 set_thread_flag(TIF_32BIT); \197 set_thread_flag(TIF_32BIT); \
200 })198 })
201#define COMPAT_ARCH_DLINFO199#define COMPAT_ARCH_DLINFO
arch/arm64/include/asm/thread_info.h+3−0
@@ -60,6 +60,9 @@ struct thread_info { · 59 unmodified lines
60#define thread_saved_fp(tsk) \60#define thread_saved_fp(tsk) \
61 ((unsigned long)(tsk->thread.cpu_context.fp))61 ((unsigned long)(tsk->thread.cpu_context.fp))
62 62
63void arch_setup_new_exec(void);
64#define arch_setup_new_exec arch_setup_new_exec
65
63#endif66#endif
64 67
65/*68/*
arch/arm64/kernel/process.c+8−0
@@ -414,3 +414,11 @@ unsigned long arch_randomize_brk(struct mm_struct *mm) · 413 unmodified lines
414 else414 else
415 return randomize_page(mm->brk, SZ_1G);415 return randomize_page(mm->brk, SZ_1G);
416}416}
417
418/*
419 * Called from setup_new_exec() after (COMPAT_)SET_PERSONALITY.
420 */
421void 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