]> git.baikalelectronics.ru Git - uboot.git/commit
virtio: pci: Check virtio common config size
authorAndrew Scull <ascull@google.com>
Thu, 21 Apr 2022 16:11:03 +0000 (16:11 +0000)
committerTom Rini <trini@konsulko.com>
Tue, 3 May 2022 19:50:45 +0000 (15:50 -0400)
commita40d90826877e8614f3db70142ef6c5fbf8e6b21
tree77e309d5c02e5ccfedf38223861f46ff9ccd8f37
parent1ac49360346bf15c96146df67daa7cfdba6e2d97
virtio: pci: Check virtio common config size

Check that the common config is at least as large as the struct it is
expected to contain. Only then is it safe to cast the pointer and be
safe from out-of-bounds accesses.

Signed-off-by: Andrew Scull <ascull@google.com>
Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
drivers/virtio/virtio_pci_modern.c