Skip to content

Commit ce5f7a9

Browse files
bpowersH. Peter Anvin
authored andcommitted
x32: Make sure TS_COMPAT is cleared for x32 tasks
If a process has a non-x32 ia32 personality and changes to x32, the process would keep its TS_COMPAT flag. x32 uses the presence of the x32 flag on a syscall to determine compat status, so make sure TS_COMPAT is cleared. Signed-off-by: Bobby Powers <bobbypowers@gmail.com> Link: http://lkml.kernel.org/r/1330230338-25077-1-git-send-email-bobbypowers@gmail.com Signed-off-by: H. Peter Anvin <hpa@zytor.com>
1 parent 3f21723 commit ce5f7a9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/x86/kernel/process_64.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -540,6 +540,9 @@ void set_personality_ia32(bool x32)
540540
clear_thread_flag(TIF_IA32);
541541
set_thread_flag(TIF_X32);
542542
current->personality &= ~READ_IMPLIES_EXEC;
543+
/* is_compat_task() uses the presence of the x32
544+
syscall bit flag to determine compat status */
545+
current_thread_info()->status &= ~TS_COMPAT;
543546
} else {
544547
set_thread_flag(TIF_IA32);
545548
clear_thread_flag(TIF_X32);

0 commit comments

Comments
 (0)