aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/i8259.c
diff options
context:
space:
mode:
authorPetr Matousek <pmatouse@redhat.com>2015-03-11 12:16:09 +0100
committerPaolo Bonzini <pbonzini@redhat.com>2015-03-30 16:40:07 +0200
commit2dccb4cdbf8fd4cb1d779a6f7ddd66d193bb5805 (patch)
treefa2ca1d0b2df5ac8e31a1bc1c47be2673cce15eb /arch/x86/kvm/i8259.c
parentMerge tag 'kvm_mips_20150327' of git://git.kernel.org/pub/scm/linux/kernel/git/jhogan/kvm-mips into kvm-next (diff)
downloadlinux-dev-2dccb4cdbf8fd4cb1d779a6f7ddd66d193bb5805.tar.xz
linux-dev-2dccb4cdbf8fd4cb1d779a6f7ddd66d193bb5805.zip
kvm: x86: i8259: return initialized data on invalid-size read
If data is read from PIC with invalid access size, the return data stays uninitialized even though success is returned. Fix this by always initializing the data. Signed-off-by: Petr Matousek <pmatouse@redhat.com> Reported-by: Nadav Amit <nadav.amit@gmail.com> Message-Id: <20150311111609.GG8544@dhcp-25-225.brq.redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'arch/x86/kvm/i8259.c')
-rw-r--r--arch/x86/kvm/i8259.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/x86/kvm/i8259.c b/arch/x86/kvm/i8259.c
index cc31f7c06d3d..9541ba34126b 100644
--- a/arch/x86/kvm/i8259.c
+++ b/arch/x86/kvm/i8259.c
@@ -507,6 +507,7 @@ static int picdev_read(struct kvm_pic *s,
return -EOPNOTSUPP;
if (len != 1) {
+ memset(val, 0, len);
pr_pic_unimpl("non byte read\n");
return 0;
}