]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
virtio/virtio_mem: handle a possible NULL as a memcpy parameter
authorPeng Hao <flyingpenghao@gmail.com>
Wed, 22 Dec 2021 01:12:25 +0000 (09:12 +0800)
committerPaolo Pisati <paolo.pisati@canonical.com>
Fri, 28 Jan 2022 09:58:59 +0000 (10:58 +0100)
commit2233e742b1d2afc182f57d26ad6b647d44e30ce2
tree0a8a9b820f58f42fece7668002ceb9740c53a229
parentb01952c4cdaf86d62adc9e1862151c69672b297e
virtio/virtio_mem: handle a possible NULL as a memcpy parameter

BugLink: https://bugs.launchpad.net/bugs/1959376
commit cf4a4493ff70874f8af26d75d4346c591c298e89 upstream.

There is a check for vm->sbm.sb_states before, and it should check
it here as well.

Signed-off-by: Peng Hao <flyingpeng@tencent.com>
Link: https://lore.kernel.org/r/20211222011225.40573-1-flyingpeng@tencent.com
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
Fixes: 5f1f79bbc9e2 ("virtio-mem: Paravirtualized memory hotplug")
Cc: stable@vger.kernel.org # v5.8+
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Paolo Pisati <paolo.pisati@canonical.com>
drivers/virtio/virtio_mem.c