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

2017-12-01 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 mea

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

2017-12-04 Thread Dave Martin
On Mon, Dec 04, 2017 at 01:53:21PM +, Ard Biesheuvel wrote: > On 1 December 2017 at 15:19, 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).

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

2017-12-05 Thread Christoffer Dall
Hi Dave, On Mon, Dec 04, 2017 at 03:36:50PM +, Dave Martin wrote: > On Mon, Dec 04, 2017 at 01:53:21PM +, Ard Biesheuvel wrote: > > On 1 December 2017 at 15:19, Dave Martin wrote: > > > When deciding whether to invalidate FPSIMD state cached in the cpu, > > > the backend function sve_flus

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

2017-12-05 Thread Dave Martin
On Tue, Dec 05, 2017 at 10:43:50AM +0100, Christoffer Dall wrote: > Hi Dave, > > On Mon, Dec 04, 2017 at 03:36:50PM +, Dave Martin wrote: > > On Mon, Dec 04, 2017 at 01:53:21PM +, Ard Biesheuvel wrote: > > > On 1 December 2017 at 15:19, Dave Martin wrote: > > > > When deciding whether to