]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: validate userspace input in kvm_clear_dirty_log_protect()
authorTomas Bortoli <tomasbortoli@gmail.com>
Wed, 2 Jan 2019 17:29:37 +0000 (18:29 +0100)
committerRadim Krčmář <rkrcmar@redhat.com>
Fri, 11 Jan 2019 17:38:07 +0000 (18:38 +0100)
commitf515f4281368c5034a9035b234f51c4942e15cd3
treebd375434926fae25fdef397e84d24d39bf891eeb
parent03b8498862997a9c43bf4fd4bae5ee2f2100bcb9
KVM: validate userspace input in kvm_clear_dirty_log_protect()

The function at issue does not fully validate the content of the
structure pointed by the log parameter, though its content has just been
copied from userspace and lacks validation. Fix that.

Moreover, change the type of n to unsigned long as that is the type
returned by kvm_dirty_bitmap_bytes().

Signed-off-by: Tomas Bortoli <tomasbortoli@gmail.com>
Reported-by: syzbot+028366e52c9ace67deb3@syzkaller.appspotmail.com
[Squashed the fix from Paolo. - Radim.]
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
virt/kvm/kvm_main.c