From: Paolo Bonzini <pbonzini@redhat.com>
To: P J P <ppandit@redhat.com>
Cc: Yang Zhang <yang.zhang.wz@gmail.com>, kvm@vger.kernel.org
Subject: Re: [PATCH] kvm: use PIT channel index in hpet_legacy_start mode
Date: Thu, 7 Jan 2016 14:50:03 +0100 [thread overview]
Message-ID: <568E6D0B.5050403@redhat.com> (raw)
In-Reply-To: <alpine.LFD.2.20.1601071847350.14967@wniryva>
On 07/01/2016 14:28, P J P wrote:
> +-- On Thu, 7 Jan 2016, Paolo Bonzini wrote --+
> | > Will this trigger the same issue like CVE-2015-7513 ?
> | > https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=0185604c2d82c560dab2f2933a18f797e74ab5a8
> |
> | I am not sure (--verbose please :))
>
> IIUC, it shouldn't, because pit_load_count() does
>
> /*
> * The largest possible initial count is 0; this is equivalent
> * to 216 for binary counting and 104 for BCD counting.
> */
> if (val == 0)
> val = 0x10000;
>
>
> | but the right fix is to change the caller like this:
>
> | diff --git a/arch/x86/kvm/i8254.c b/arch/x86/kvm/i8254.c
> | @@ -420,6 +420,7 @@ 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 */
> | + WARN_ON(channel != 0);
> | saved_mode = kvm->arch.vpit->pit_state.channels[0].mode;
> | kvm->arch.vpit->pit_state.channels[0].mode = 0xff; /* disable timer */
> | pit_load_count(kvm, channel, val);
>
> In that case I guess, 'pit_load_count' could be called as
>
> + pit_load_count(kvm, 0, val);
Good idea.
Paolo
>
> Thank you.
> --
> - P J P
> 47AF CE69 3A90 54AA 9045 1053 DD13 3D32 FE5B 041F
>
prev parent reply other threads:[~2016-01-07 13:50 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
2016-01-07 12:50 ` Paolo Bonzini
2016-01-07 13:28 ` P J P
2016-01-07 13:50 ` 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=568E6D0B.5050403@redhat.com \
--to=pbonzini@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=ppandit@redhat.com \
--cc=yang.zhang.wz@gmail.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.