PCI/IOV: Remove group write permission from sriov_numvfs, sriov_drivers_autoprobe

Previously the sriov_numvfs and sriov_drivers_autoprobe sysfs files had
0664 permissions, which allowed group write.  libvirt runs as root when
dealing with PCI, and it chowns files needed by qemu, so group write
permission should not be needed.

Change these permissions from 0664 to 0644, which is what DEVICE_ATTR_RW()
does by default.

[bhelgaas: commit log]
Link: https://lore.kernel.org/r/20190905063226.43269-1-skunberg.kelsey@gmail.com
Link: https://lore.kernel.org/r/850cf536-0b72-d78c-efaf-855dcb391087@redhat.com
Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Donald Dutile <ddutile@redhat.com>
This commit is contained in:
Kelsey Skunberg 2019-09-05 00:32:26 -06:00 committed by Bjorn Helgaas
parent aaee0c1ffd
commit 244c06c3b6

View File

@ -375,12 +375,11 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
} }
static DEVICE_ATTR_RO(sriov_totalvfs); static DEVICE_ATTR_RO(sriov_totalvfs);
static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store); static DEVICE_ATTR_RW(sriov_numvfs);
static DEVICE_ATTR_RO(sriov_offset); static DEVICE_ATTR_RO(sriov_offset);
static DEVICE_ATTR_RO(sriov_stride); static DEVICE_ATTR_RO(sriov_stride);
static DEVICE_ATTR_RO(sriov_vf_device); static DEVICE_ATTR_RO(sriov_vf_device);
static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show, static DEVICE_ATTR_RW(sriov_drivers_autoprobe);
sriov_drivers_autoprobe_store);
static struct attribute *sriov_dev_attrs[] = { static struct attribute *sriov_dev_attrs[] = {
&dev_attr_sriov_totalvfs.attr, &dev_attr_sriov_totalvfs.attr,