summaryrefslogtreecommitdiff
path: root/kernel/power/hibernate.c
diff options
context:
space:
mode:
authorVlad Tsyrklevich <vlad@tsyrklevich.net>2016-10-12 18:51:24 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2017-04-30 05:49:29 +0200
commitd23ef85b123d3dbd3ba8a3c5f0ef5e556feb635e (patch)
treed4ed2baf9194169b6854d9f88cce3da74852f2d7 /kernel/power/hibernate.c
parent65d30f7545ffdddcf10a59f3e54b032c5ade2e9d (diff)
vfio/pci: Fix integer overflows, bitmask check
commit 05692d7005a364add85c6e25a6c4447ce08f913a upstream. The VFIO_DEVICE_SET_IRQS ioctl did not sufficiently sanitize user-supplied integers, potentially allowing memory corruption. This patch adds appropriate integer overflow checks, checks the range bounds for VFIO_IRQ_SET_DATA_NONE, and also verifies that only single element in the VFIO_IRQ_SET_DATA_TYPE_MASK bitmask is set. VFIO_IRQ_SET_ACTION_TYPE_MASK is already correctly checked later in vfio_pci_set_irqs_ioctl(). Furthermore, a kzalloc is changed to a kcalloc because the use of a kzalloc with an integer multiplication allowed an integer overflow condition to be reached without this patch. kcalloc checks for overflow and should prevent a similar occurrence. Signed-off-by: Vlad Tsyrklevich <vlad@tsyrklevich.net> Signed-off-by: Alex Williamson <alex.williamson@redhat.com> Cc: Ben Hutchings <ben.hutchings@codethink.co.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'kernel/power/hibernate.c')
0 files changed, 0 insertions, 0 deletions