Zelin Deng 773e89ab00 ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm
hv_clock is preallocated to have only HVC_BOOT_ARRAY_SIZE (64) elements;
if the PTP_SYS_OFFSET_PRECISE ioctl is executed on vCPUs whose index is
64 of higher, retrieving the struct pvclock_vcpu_time_info pointer with
"src = &hv_clock[cpu].pvti" will result in an out-of-bounds access and
a wild pointer.  Change it to "this_cpu_pvti()" which is guaranteed to
be valid.

Fixes: 95a3d4454bb1 ("Switch kvmclock data to a PER_CPU variable")
Signed-off-by: Zelin Deng <zelin.deng@linux.alibaba.com>
Cc: <stable@vger.kernel.org>
Message-Id: <1632892429-101194-3-git-send-email-zelin.deng@linux.alibaba.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-09-30 04:08:15 -04:00
..
2021-09-10 13:29:04 -07:00
2021-09-17 08:31:49 -07:00
2021-09-01 08:44:42 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-07 12:38:59 -07:00
2021-09-07 19:13:42 -07:00
2021-09-09 11:48:27 -07:00
2021-09-09 11:39:57 -07:00
2021-09-08 11:50:26 -07:00
2021-09-09 11:07:47 -07:00
2021-09-01 08:44:42 -07:00
2021-09-07 12:27:27 -07:00
2021-09-15 17:18:56 -07:00
2021-09-01 08:44:42 -07:00
2021-09-02 13:49:39 -07:00
2021-09-11 14:48:42 -07:00
2021-09-01 09:51:16 -07:00
2021-09-03 15:33:47 -07:00
2021-09-09 11:39:57 -07:00
2021-09-01 08:44:42 -07:00
2021-09-07 12:38:59 -07:00
2021-09-12 11:56:00 -07:00
2021-09-09 11:48:27 -07:00
2021-09-15 07:53:32 -06:00
2021-09-20 12:43:34 +01:00
2021-09-03 15:33:47 -07:00
2021-09-08 16:43:46 -07:00
2021-09-01 15:25:28 -07:00
2021-09-15 14:29:21 +02:00
2021-09-07 19:13:42 -07:00
2021-09-01 08:44:42 -07:00
2021-09-01 15:25:28 -07:00
2021-09-01 10:29:29 -07:00
2021-09-03 15:33:47 -07:00
2021-09-02 15:09:46 -07:00
2021-09-05 11:19:15 -07:00
2021-09-11 14:48:42 -07:00
2021-09-02 13:41:33 -07:00
2021-09-18 11:15:01 -07:00
2021-09-11 14:48:42 -07:00
2021-09-17 08:31:49 -07:00