aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorPetr Matousek <pmatouse@redhat.com>2015-03-11 07:16:09 -0400
committerMarcelo Tosatti <mtosatti@redhat.com>2015-03-12 21:02:46 -0400
commitc1a6bff28cbff796bf6e7db5cf42ec9244911be2 (patch)
tree09dd8804b784217ec2fd387bbe2ecf230c6b837e /arch/x86/kvm
parentdc9be0fac70a2ad86e31a81372bb0bdfb6945353 (diff)
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> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-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,
507 return -EOPNOTSUPP; 507 return -EOPNOTSUPP;
508 508
509 if (len != 1) { 509 if (len != 1) {
510 memset(val, 0, len);
510 pr_pic_unimpl("non byte read\n"); 511 pr_pic_unimpl("non byte read\n");
511 return 0; 512 return 0;
512 } 513 }