Skip to content
Commit 865a11f9 authored by Venkatesh Srinivas's avatar Venkatesh Srinivas Committed by Greg Kroah-Hartman
Browse files

uio/uio_pci_generic: Disable bus-mastering on release



Userspace code using uio_pci_generic may enable bus-mastering by
directly manipulating a PCI device's command register. If a userspace
program enables bus-mastering but exits/crashes uncleanly, bus-
mastering will still be enabled and stale DMA addresses may be
programmed and live in the device.

Disable bus-mastering unconditionally on last close of a UIO PCI fd
to avoid this. If the device did not have bus-mastering enabled,
pci_clear_master() is a no-op.

Signed-off-by: default avatarVenkatesh Srinivas <venkateshs@google.com>
Reviewed-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Reviewed-by: default avatarCatherine Sullivan <csully@google.com>
Acked-by: default avatarMichael S. Tsirkin <mst@redhat.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e5bae743
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment