Re: [RFC PATCH 2/4] arm64/sve: KVM: Avoid dereference of dead task during guest entry

2017-11-23 Thread Dave Martin
On Wed, Nov 22, 2017 at 08:23:38PM +0100, Christoffer Dall wrote: > Hi Dave, > > On Fri, Nov 17, 2017 at 04:38:53PM +, Dave Martin wrote: > > When deciding whether to invalidate FPSIMD state cached in the cpu, > > the backend function sve_flush_cpu_state() attempts to dereference > >

Re: [RFC PATCH 2/4] arm64/sve: KVM: Avoid dereference of dead task during guest entry

2017-11-22 Thread Christoffer Dall
Hi Dave, On Fri, Nov 17, 2017 at 04:38:53PM +, Dave Martin wrote: > When deciding whether to invalidate FPSIMD state cached in the cpu, > the backend function sve_flush_cpu_state() attempts to dereference > __this_cpu_read(fpsimd_last_state). However, this is not safe: > there is no

[RFC PATCH 2/4] arm64/sve: KVM: Avoid dereference of dead task during guest entry

2017-11-17 Thread Dave Martin
When deciding whether to invalidate FPSIMD state cached in the cpu, the backend function sve_flush_cpu_state() attempts to dereference __this_cpu_read(fpsimd_last_state). However, this is not safe: there is no guarantee that the pointer is still valid, because the task could have exited in the