diff options
author | yongduan <[email protected]> | 2019-09-11 17:44:24 +0800 |
---|---|---|
committer | Michael S. Tsirkin <[email protected]> | 2019-09-11 15:15:26 -0400 |
commit | 060423bfdee3f8bc6e2c1bac97de24d5415e2bc4 (patch) | |
tree | 1d29fdf287bcd13ee916712b2d31ac2cd6ad449d /lib/memory-notifier-error-inject.c | |
parent | a89db445fbd7f1f8457b03759aa7343fa530ef6b (diff) |
vhost: make sure log_num < in_num
The code assumes log_num < in_num everywhere, and that is true as long as
in_num is incremented by descriptor iov count, and log_num by 1. However
this breaks if there's a zero sized descriptor.
As a result, if a malicious guest creates a vring desc with desc.len = 0,
it may cause the host kernel to crash by overflowing the log array. This
bug can be triggered during the VM migration.
There's no need to log when desc.len = 0, so just don't increment log_num
in this case.
Fixes: 3a4d5c94e959 ("vhost_net: a kernel-level virtio server")
Cc: [email protected]
Reviewed-by: Lidong Chen <[email protected]>
Signed-off-by: ruippan <[email protected]>
Signed-off-by: yongduan <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Reviewed-by: Tyler Hicks <[email protected]>
Signed-off-by: Michael S. Tsirkin <[email protected]>
Diffstat (limited to 'lib/memory-notifier-error-inject.c')
0 files changed, 0 insertions, 0 deletions