Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c1a6bff2 authored by Petr Matousek's avatar Petr Matousek Committed by Marcelo Tosatti
Browse files

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: default avatarPetr Matousek <pmatouse@redhat.com>
Reported-by: default avatarNadav Amit <nadav.amit@gmail.com>
Signed-off-by: default avatarMarcelo Tosatti <mtosatti@redhat.com>
parent dc9be0fa
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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;
	}