diff options
Diffstat (limited to 'arch/x86')
-rw-r--r-- | arch/x86/kernel/process_64.c | 7 | ||||
-rw-r--r-- | arch/x86/kernel/uprobes.c | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/arch/x86/kernel/process_64.c b/arch/x86/kernel/process_64.c index 9c0280f93d05..9b53940981b7 100644 --- a/arch/x86/kernel/process_64.c +++ b/arch/x86/kernel/process_64.c | |||
@@ -413,12 +413,11 @@ void set_personality_ia32(bool x32) | |||
413 | set_thread_flag(TIF_ADDR32); | 413 | set_thread_flag(TIF_ADDR32); |
414 | 414 | ||
415 | /* Mark the associated mm as containing 32-bit tasks. */ | 415 | /* Mark the associated mm as containing 32-bit tasks. */ |
416 | if (current->mm) | ||
417 | current->mm->context.ia32_compat = 1; | ||
418 | |||
419 | if (x32) { | 416 | if (x32) { |
420 | clear_thread_flag(TIF_IA32); | 417 | clear_thread_flag(TIF_IA32); |
421 | set_thread_flag(TIF_X32); | 418 | set_thread_flag(TIF_X32); |
419 | if (current->mm) | ||
420 | current->mm->context.ia32_compat = TIF_X32; | ||
422 | current->personality &= ~READ_IMPLIES_EXEC; | 421 | current->personality &= ~READ_IMPLIES_EXEC; |
423 | /* is_compat_task() uses the presence of the x32 | 422 | /* is_compat_task() uses the presence of the x32 |
424 | syscall bit flag to determine compat status */ | 423 | syscall bit flag to determine compat status */ |
@@ -426,6 +425,8 @@ void set_personality_ia32(bool x32) | |||
426 | } else { | 425 | } else { |
427 | set_thread_flag(TIF_IA32); | 426 | set_thread_flag(TIF_IA32); |
428 | clear_thread_flag(TIF_X32); | 427 | clear_thread_flag(TIF_X32); |
428 | if (current->mm) | ||
429 | current->mm->context.ia32_compat = TIF_IA32; | ||
429 | current->personality |= force_personality32; | 430 | current->personality |= force_personality32; |
430 | /* Prepare the first "return" to user space */ | 431 | /* Prepare the first "return" to user space */ |
431 | current_thread_info()->status |= TS_COMPAT; | 432 | current_thread_info()->status |= TS_COMPAT; |
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c index 892975b3c99c..ecbffd16d090 100644 --- a/arch/x86/kernel/uprobes.c +++ b/arch/x86/kernel/uprobes.c | |||
@@ -245,7 +245,7 @@ static int uprobe_init_insn(struct arch_uprobe *auprobe, struct insn *insn, bool | |||
245 | static inline bool is_64bit_mm(struct mm_struct *mm) | 245 | static inline bool is_64bit_mm(struct mm_struct *mm) |
246 | { | 246 | { |
247 | return !config_enabled(CONFIG_IA32_EMULATION) || | 247 | return !config_enabled(CONFIG_IA32_EMULATION) || |
248 | !mm->context.ia32_compat; | 248 | !(mm->context.ia32_compat == TIF_IA32); |
249 | } | 249 | } |
250 | /* | 250 | /* |
251 | * If arch_uprobe->insn doesn't use rip-relative addressing, return | 251 | * If arch_uprobe->insn doesn't use rip-relative addressing, return |