public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Paolo Bonzini <pbonzini@redhat.com>
To: Zelin Deng <zelin.deng@linux.alibaba.com>,
	Thomas Gleixner <tglx@linutronix.de>
Cc: x86@kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org
Subject: Re: [PATCH 0/2] Fix wild/dangling pointer in x86 ptp_kvm
Date: Wed, 29 Sep 2021 14:57:32 +0200	[thread overview]
Message-ID: <e194b33f-cc6e-bdfe-186b-12fa37b81a3e@redhat.com> (raw)
In-Reply-To: <1632892429-101194-1-git-send-email-zelin.deng@linux.alibaba.com>

On 29/09/21 07:13, Zelin Deng wrote:
> When I was doing PTP_SYS_OFFSET_PRECISE ioctl in VM which has 128 vCPUs,
> I got error returned occasionally. Then I checked the routine of
> "getcrosststamp". I found in kvm_arch_ptp_get_crosststamp() of x86,
> pvclock vcpu time info was got from hv_clock arrary which has only 64
> elements. Hence this ioctl is executed on vCPU > 64, a wild/dangling
> pointer will be got, which had casued the error.
> To confirm this finding, I wrote a simple PTP_SYS_OFFSET_PRECISE ioctl
> test and used "taskset -c n" to run the test, when it was executed on
> vCPUs >= 64 it returned error.
> This patchset exposes this_cpu_pvti() to get per cpu pvclock vcpu time
> info of vCPUs >= 64 insdead of getting them from hv_clock arrary.
> 
> Zelin Deng (2):
>    x86/kvmclock: Move this_cpu_pvti into kvmclock.h
>    ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm
> 
>   arch/x86/include/asm/kvmclock.h | 14 ++++++++++++++
>   arch/x86/kernel/kvmclock.c      | 13 ++-----------
>   drivers/ptp/ptp_kvm_x86.c       |  9 ++-------
>   3 files changed, 18 insertions(+), 18 deletions(-)
> 

Queued, thanks.

Paolo


      parent reply	other threads:[~2021-09-29 12:57 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-29  5:13 [PATCH 0/2] Fix wild/dangling pointer in x86 ptp_kvm Zelin Deng
2021-09-29  5:13 ` [PATCH 1/2] x86/kvmclock: Move this_cpu_pvti into kvmclock.h Zelin Deng
2021-09-29  5:13 ` [PATCH 2/2] ptp: Fix ptp_kvm_getcrosststamp issue for x86 ptp_kvm Zelin Deng
2021-09-29 12:57 ` Paolo Bonzini [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e194b33f-cc6e-bdfe-186b-12fa37b81a3e@redhat.com \
    --to=pbonzini@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    --cc=zelin.deng@linux.alibaba.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox