From: helgaas at kernel.org (Bjorn Helgaas)
Subject: [Linux-kernel-mentees] [PATCH] PCI/IOV: Make SR-IOV attributes with mode 0664 use 0644
Date: Thu, 5 Sep 2019 13:29:38 -0500 [thread overview]
Message-ID: <20190905182938.GD103977@google.com> (raw)
In-Reply-To: <20190905063226.43269-1-skunberg.kelsey@gmail.com>
[+cc Bodong, Eli: just FYI since this affects sriov_drivers_autoprobe,
which you added with 0e7df22401a3]
On Thu, Sep 05, 2019 at 12:32:26AM -0600, Kelsey Skunberg wrote:
> sriov_numvfs and sriov_drivers_autoprobe have "unusual" permissions (0664)
> with no reported or found reason for allowing group write permissions.
> libvirt runs as root when dealing with PCI, and chowns files for qemu
> needs. There is not a need for the "0664" permissions.
>
> sriov_numvfs was introduced in:
> commit 1789382a72a5 ("PCI: SRIOV control and status via sysfs")
>
> sriov_drivers_autoprobe was introduced in:
> commit 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to
> control VF driver binding")
>
> Change sriov_numvfs and sriov_drivers_autoprobe from "0664" permissions to
> "0644" permissions.
>
> Exchange DEVICE_ATTR() with DEVICE_ATTR_RW() which sets the mode to "0644".
> DEVICE_ATTR() should only be used for "unusual" permissions.
>
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey at gmail.com>
Applied with Greg's Reviewed-by and Don's Acked-by to pci/misc for
v5.4, thanks!
> ---
> drivers/pci/iov.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index b335db21c85e..b3f972e8cfed 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -375,12 +375,11 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
> }
>
> 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_stride);
> static DEVICE_ATTR_RO(sriov_vf_device);
> -static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> - sriov_drivers_autoprobe_store);
> +static DEVICE_ATTR_RW(sriov_drivers_autoprobe);
>
> static struct attribute *sriov_dev_attrs[] = {
> &dev_attr_sriov_totalvfs.attr,
> --
> 2.20.1
>
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: helgaas@kernel.org (Bjorn Helgaas)
Subject: [Linux-kernel-mentees] [PATCH] PCI/IOV: Make SR-IOV attributes with mode 0664 use 0644
Date: Thu, 5 Sep 2019 13:29:38 -0500 [thread overview]
Message-ID: <20190905182938.GD103977@google.com> (raw)
Message-ID: <20190905182938.-Px4E0vCAYh8N_bEcQgwIw9Nvm7u0cP3nWfCPEScbHc@z> (raw)
In-Reply-To: <20190905063226.43269-1-skunberg.kelsey@gmail.com>
[+cc Bodong, Eli: just FYI since this affects sriov_drivers_autoprobe,
which you added with 0e7df22401a3]
On Thu, Sep 05, 2019 at 12:32:26AM -0600, Kelsey Skunberg wrote:
> sriov_numvfs and sriov_drivers_autoprobe have "unusual" permissions (0664)
> with no reported or found reason for allowing group write permissions.
> libvirt runs as root when dealing with PCI, and chowns files for qemu
> needs. There is not a need for the "0664" permissions.
>
> sriov_numvfs was introduced in:
> commit 1789382a72a5 ("PCI: SRIOV control and status via sysfs")
>
> sriov_drivers_autoprobe was introduced in:
> commit 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to
> control VF driver binding")
>
> Change sriov_numvfs and sriov_drivers_autoprobe from "0664" permissions to
> "0644" permissions.
>
> Exchange DEVICE_ATTR() with DEVICE_ATTR_RW() which sets the mode to "0644".
> DEVICE_ATTR() should only be used for "unusual" permissions.
>
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey at gmail.com>
Applied with Greg's Reviewed-by and Don's Acked-by to pci/misc for
v5.4, thanks!
> ---
> drivers/pci/iov.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index b335db21c85e..b3f972e8cfed 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -375,12 +375,11 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
> }
>
> 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_stride);
> static DEVICE_ATTR_RO(sriov_vf_device);
> -static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> - sriov_drivers_autoprobe_store);
> +static DEVICE_ATTR_RW(sriov_drivers_autoprobe);
>
> static struct attribute *sriov_dev_attrs[] = {
> &dev_attr_sriov_totalvfs.attr,
> --
> 2.20.1
>
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees at lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
WARNING: multiple messages have this Message-ID (diff)
From: Bjorn Helgaas <helgaas@kernel.org>
To: Kelsey Skunberg <skunberg.kelsey@gmail.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
sathyanarayanan.kuppuswamy@linux.intel.com, berrange@redhat.com,
ddutile@redhat.com, bodong@mellanox.com,
linux-kernel-mentees@lists.linuxfoundation.org,
Eli Cohen <eli@mellanox.com>
Subject: Re: [Linux-kernel-mentees] [PATCH] PCI/IOV: Make SR-IOV attributes with mode 0664 use 0644
Date: Thu, 5 Sep 2019 13:29:38 -0500 [thread overview]
Message-ID: <20190905182938.GD103977@google.com> (raw)
In-Reply-To: <20190905063226.43269-1-skunberg.kelsey@gmail.com>
[+cc Bodong, Eli: just FYI since this affects sriov_drivers_autoprobe,
which you added with 0e7df22401a3]
On Thu, Sep 05, 2019 at 12:32:26AM -0600, Kelsey Skunberg wrote:
> sriov_numvfs and sriov_drivers_autoprobe have "unusual" permissions (0664)
> with no reported or found reason for allowing group write permissions.
> libvirt runs as root when dealing with PCI, and chowns files for qemu
> needs. There is not a need for the "0664" permissions.
>
> sriov_numvfs was introduced in:
> commit 1789382a72a5 ("PCI: SRIOV control and status via sysfs")
>
> sriov_drivers_autoprobe was introduced in:
> commit 0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to
> control VF driver binding")
>
> Change sriov_numvfs and sriov_drivers_autoprobe from "0664" permissions to
> "0644" permissions.
>
> Exchange DEVICE_ATTR() with DEVICE_ATTR_RW() which sets the mode to "0644".
> DEVICE_ATTR() should only be used for "unusual" permissions.
>
> Signed-off-by: Kelsey Skunberg <skunberg.kelsey@gmail.com>
Applied with Greg's Reviewed-by and Don's Acked-by to pci/misc for
v5.4, thanks!
> ---
> drivers/pci/iov.c | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/pci/iov.c b/drivers/pci/iov.c
> index b335db21c85e..b3f972e8cfed 100644
> --- a/drivers/pci/iov.c
> +++ b/drivers/pci/iov.c
> @@ -375,12 +375,11 @@ static ssize_t sriov_drivers_autoprobe_store(struct device *dev,
> }
>
> 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_stride);
> static DEVICE_ATTR_RO(sriov_vf_device);
> -static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> - sriov_drivers_autoprobe_store);
> +static DEVICE_ATTR_RW(sriov_drivers_autoprobe);
>
> static struct attribute *sriov_dev_attrs[] = {
> &dev_attr_sriov_totalvfs.attr,
> --
> 2.20.1
>
> _______________________________________________
> Linux-kernel-mentees mailing list
> Linux-kernel-mentees@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/linux-kernel-mentees
next prev parent reply other threads:[~2019-09-05 18:29 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-09-05 6:32 [Linux-kernel-mentees] [PATCH] PCI/IOV: Make SR-IOV attributes with mode 0664 use 0644 skunberg.kelsey
2019-09-05 6:32 ` Kelsey Skunberg
2019-09-05 6:32 ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-09-05 7:34 ` gregkh
2019-09-05 7:34 ` Greg KH
2019-09-05 7:34 ` [Linux-kernel-mentees] " Greg KH
2019-09-05 19:16 ` skunberg.kelsey
2019-09-05 19:16 ` Kelsey Skunberg
2019-09-05 19:16 ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-09-05 16:24 ` ddutile
2019-09-05 16:24 ` Don Dutile
2019-09-05 16:24 ` [Linux-kernel-mentees] " Don Dutile
2019-09-05 19:19 ` skunberg.kelsey
2019-09-05 19:19 ` Kelsey Skunberg
2019-09-05 19:19 ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-09-05 18:29 ` helgaas [this message]
2019-09-05 18:29 ` Bjorn Helgaas
2019-09-05 18:29 ` Bjorn Helgaas
2019-09-05 19:21 ` skunberg.kelsey
2019-09-05 19:21 ` Kelsey Skunberg
2019-09-05 19:21 ` Kelsey Skunberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190905182938.GD103977@google.com \
--to=unknown@example.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.