All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yang Zhang <yang.zhang.wz@gmail.com>
To: P J P <ppandit@redhat.com>, kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>, P J P <pjp@fedoraproject.org>
Subject: Re: [PATCH] kvm: use PIT channel index in hpet_legacy_start mode
Date: Thu, 7 Jan 2016 20:37:31 +0800	[thread overview]
Message-ID: <568E5C0B.9010507@gmail.com> (raw)
In-Reply-To: <1452169950-14711-1-git-send-email-ppandit@redhat.com>

On 2016/1/7 20:32, P J P wrote:
> From: P J P <pjp@fedoraproject.org>
>
> While setting the KVM PIT counters in 'kvm_pit_load_count', if
> 'hpet_legacy_start' is set, the function disables the timer on
> channel[0], instead of the respective index 'channel'. Update it
> to use 'channel' index parameter.
>
> Signed-off-by: P J P <pjp@fedoraproject.org>
> ---
>   arch/x86/kvm/i8254.c | 7 ++++---
>   1 file changed, 4 insertions(+), 3 deletions(-)
>
> diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> index 08116ff..154e936 100644
> --- a/arch/x86/kvm/i8254.c
> +++ b/arch/x86/kvm/i8254.c
> @@ -420,10 +420,11 @@ void kvm_pit_load_count(struct kvm *kvm, int channel, u32 val, int hpet_legacy_s
>   	u8 saved_mode;
>   	if (hpet_legacy_start) {
>   		/* save existing mode for later reenablement */
> -		saved_mode = kvm->arch.vpit->pit_state.channels[0].mode;
> -		kvm->arch.vpit->pit_state.channels[0].mode = 0xff; /* disable timer */
> +		saved_mode = kvm->arch.vpit->pit_state.channels[channel].mode;
> +		/* disable timer */
> +		kvm->arch.vpit->pit_state.channels[channel].mode = 0xff;
>   		pit_load_count(kvm, channel, val);
> -		kvm->arch.vpit->pit_state.channels[0].mode = saved_mode;
> +		kvm->arch.vpit->pit_state.channels[channel].mode = saved_mode;
>   	} else {
>   		pit_load_count(kvm, channel, val);
>   	}
>

Will this trigger the same issue like CVE-2015-7513 ?

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0185604c2d82c560dab2f2933a18f797e74ab5a8

-- 
best regards
yang

  reply	other threads:[~2016-01-07 12:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-07 12:32 [PATCH] kvm: use PIT channel index in hpet_legacy_start mode P J P
2016-01-07 12:37 ` Yang Zhang [this message]
2016-01-07 12:50   ` Paolo Bonzini
2016-01-07 13:28     ` P J P
2016-01-07 13:50       ` Paolo Bonzini

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=568E5C0B.9010507@gmail.com \
    --to=yang.zhang.wz@gmail.com \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=pjp@fedoraproject.org \
    --cc=ppandit@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.