linux-stable/arch
Ard Biesheuvel 674c242c93 arm64: flush FP/SIMD state correctly after execve()
When a task calls execve(), its FP/SIMD state is flushed so that
none of the original program state is observeable by the incoming
program.

However, since this flushing consists of setting the in-memory copy
of the FP/SIMD state to all zeroes, the CPU field is set to CPU 0 as
well, which indicates to the lazy FP/SIMD preserve/restore code that
the FP/SIMD state does not need to be reread from memory if the task
is scheduled again on CPU 0 without any other tasks having entered
userland (or used the FP/SIMD in kernel mode) on the same CPU in the
mean time. If this happens, the FP/SIMD state of the old program will
still be present in the registers when the new program starts.

So set the CPU field to the invalid value of NR_CPUS when performing
the flush, by calling fpsimd_flush_task_state().

Cc: <stable@vger.kernel.org>
Reported-by: Chunyan Zhang <chunyan.zhang@spreadtrum.com>
Reported-by: Janet Liu <janet.liu@spreadtrum.com>
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Signed-off-by: Will Deacon <will.deacon@arm.com>
2015-08-27 09:55:26 +01:00
..
alpha atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
arc atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
arm atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
arm64 arm64: flush FP/SIMD state correctly after execve() 2015-08-27 09:55:26 +01:00
avr32 atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
blackfin atomic: Replace atomic_{set,clear}_mask() usage 2015-07-27 14:06:24 +02:00
c6x mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
cris mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
frv atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
h8300 atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
hexagon atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
ia64 atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
m32r atomic: Replace atomic_{set,clear}_mask() usage 2015-07-27 14:06:24 +02:00
m68k atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
metag atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
microblaze mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
mips atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
mn10300 atomic: Replace atomic_{set,clear}_mask() usage 2015-07-27 14:06:24 +02:00
nios2 mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
openrisc mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
parisc atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
powerpc atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
s390 atomic: Replace atomic_{set,clear}_mask() usage 2015-07-27 14:06:24 +02:00
score mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
sh atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
sparc atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
tile atomic: Provide atomic_{or,xor,and} 2015-07-27 14:06:24 +02:00
um mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
unicore32 mm: clean up per architecture MM hook header files 2015-07-17 16:39:53 -07:00
x86 atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
xtensa atomic: Collapse all atomic_{set,clear}_mask definitions 2015-07-27 14:06:24 +02:00
.gitignore
Kconfig x86/fpu, sched: Introduce CONFIG_ARCH_WANTS_DYNAMIC_TASK_STRUCT and use it on x86 2015-07-18 03:42:51 +02:00