All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Bjorn Helgaas <helgaas@kernel.org>
Cc: Kelsey Skunberg <skunberg.kelsey@gmail.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-kernel-mentees@lists.linuxfoundation.org,
	Bodong Wang <bodong@mellanox.com>,
	Donald Dutile <ddutile@redhat.com>
Subject: Re: [Linux-kernel-mentees] [PATCH v2 2/3] PCI: sysfs: Change permissions from symbolic to octal
Date: Wed, 14 Aug 2019 09:53:24 +0200	[thread overview]
Message-ID: <20190814075324.GB4067@kroah.com> (raw)
In-Reply-To: <20190814053846.GA253360@google.com>

On Wed, Aug 14, 2019 at 12:38:46AM -0500, Bjorn Helgaas wrote:
> [+cc Bodong, Don, Greg for permission question]
> 
> On Tue, Aug 13, 2019 at 02:45:12PM -0600, Kelsey Skunberg wrote:
> > Symbolic permissions such as "(S_IWUSR | S_IWGRP)" are not
> > preferred and octal permissions should be used instead. Change all
> > symbolic permissions to octal permissions.
> > 
> > Example of old:
> > 
> > "(S_IWUSR | S_IWGRP)"
> > 
> > Example of new:
> > 
> > "0220"
> 
> 
> >  static DEVICE_ATTR_RO(sriov_totalvfs);
> > -static DEVICE_ATTR(sriov_numvfs, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -				  sriov_numvfs_show, sriov_numvfs_store);
> > +static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store);
> >  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, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -		   sriov_drivers_autoprobe_show, sriov_drivers_autoprobe_store);
> > +static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> > +		   sriov_drivers_autoprobe_store);
> 
> Greg noticed that sriov_numvfs and sriov_drivers_autoprobe have
> "unusual" permissions.  These were added by:
> 
>   0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding")
>   1789382a72a5 ("PCI: SRIOV control and status via sysfs")
> 
> Kelsey's patch correctly preserves the existing permissions, but we
> should double-check that they are the permissions they want, and
> possibly add a comment about why they're different from the rest.

I agree.  And if those permissions are ok, please put a HUGE comment in
here saying why they are what they are and why they need to stay that
way so we don't have this conversation again in a few years :)

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: gregkh at linuxfoundation.org (Greg Kroah-Hartman)
Subject: [Linux-kernel-mentees] [PATCH v2 2/3] PCI: sysfs: Change permissions from symbolic to octal
Date: Wed, 14 Aug 2019 09:53:24 +0200	[thread overview]
Message-ID: <20190814075324.GB4067@kroah.com> (raw)
In-Reply-To: <20190814053846.GA253360@google.com>

On Wed, Aug 14, 2019 at 12:38:46AM -0500, Bjorn Helgaas wrote:
> [+cc Bodong, Don, Greg for permission question]
> 
> On Tue, Aug 13, 2019 at 02:45:12PM -0600, Kelsey Skunberg wrote:
> > Symbolic permissions such as "(S_IWUSR | S_IWGRP)" are not
> > preferred and octal permissions should be used instead. Change all
> > symbolic permissions to octal permissions.
> > 
> > Example of old:
> > 
> > "(S_IWUSR | S_IWGRP)"
> > 
> > Example of new:
> > 
> > "0220"
> 
> 
> >  static DEVICE_ATTR_RO(sriov_totalvfs);
> > -static DEVICE_ATTR(sriov_numvfs, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -				  sriov_numvfs_show, sriov_numvfs_store);
> > +static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store);
> >  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, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -		   sriov_drivers_autoprobe_show, sriov_drivers_autoprobe_store);
> > +static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> > +		   sriov_drivers_autoprobe_store);
> 
> Greg noticed that sriov_numvfs and sriov_drivers_autoprobe have
> "unusual" permissions.  These were added by:
> 
>   0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding")
>   1789382a72a5 ("PCI: SRIOV control and status via sysfs")
> 
> Kelsey's patch correctly preserves the existing permissions, but we
> should double-check that they are the permissions they want, and
> possibly add a comment about why they're different from the rest.

I agree.  And if those permissions are ok, please put a HUGE comment in
here saying why they are what they are and why they need to stay that
way so we don't have this conversation again in a few years :)

thanks,

greg k-h

WARNING: multiple messages have this Message-ID (diff)
From: gregkh@linuxfoundation.org (Greg Kroah-Hartman)
Subject: [Linux-kernel-mentees] [PATCH v2 2/3] PCI: sysfs: Change permissions from symbolic to octal
Date: Wed, 14 Aug 2019 09:53:24 +0200	[thread overview]
Message-ID: <20190814075324.GB4067@kroah.com> (raw)
Message-ID: <20190814075324.6SPVkJSS3-UviNyGphZrSkjsYvrEq9laTxWCaqGyMaw@z> (raw)
In-Reply-To: <20190814053846.GA253360@google.com>

On Wed, Aug 14, 2019 at 12:38:46AM -0500, Bjorn Helgaas wrote:
> [+cc Bodong, Don, Greg for permission question]
> 
> On Tue, Aug 13, 2019 at 02:45:12PM -0600, Kelsey Skunberg wrote:
> > Symbolic permissions such as "(S_IWUSR | S_IWGRP)" are not
> > preferred and octal permissions should be used instead. Change all
> > symbolic permissions to octal permissions.
> > 
> > Example of old:
> > 
> > "(S_IWUSR | S_IWGRP)"
> > 
> > Example of new:
> > 
> > "0220"
> 
> 
> >  static DEVICE_ATTR_RO(sriov_totalvfs);
> > -static DEVICE_ATTR(sriov_numvfs, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -				  sriov_numvfs_show, sriov_numvfs_store);
> > +static DEVICE_ATTR(sriov_numvfs, 0664, sriov_numvfs_show, sriov_numvfs_store);
> >  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, (S_IRUGO | S_IWUSR | S_IWGRP),
> > -		   sriov_drivers_autoprobe_show, sriov_drivers_autoprobe_store);
> > +static DEVICE_ATTR(sriov_drivers_autoprobe, 0664, sriov_drivers_autoprobe_show,
> > +		   sriov_drivers_autoprobe_store);
> 
> Greg noticed that sriov_numvfs and sriov_drivers_autoprobe have
> "unusual" permissions.  These were added by:
> 
>   0e7df22401a3 ("PCI: Add sysfs sriov_drivers_autoprobe to control VF driver binding")
>   1789382a72a5 ("PCI: SRIOV control and status via sysfs")
> 
> Kelsey's patch correctly preserves the existing permissions, but we
> should double-check that they are the permissions they want, and
> possibly add a comment about why they're different from the rest.

I agree.  And if those permissions are ok, please put a HUGE comment in
here saying why they are what they are and why they need to stay that
way so we don't have this conversation again in a few years :)

thanks,

greg k-h

  reply	other threads:[~2019-08-14  7:53 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-08-09 19:57 [PATCH] PCI/IOV: Move sysfs SR-IOV functions to iov.c Kelsey Skunberg
2019-08-09 19:57 ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-09 19:57 ` skunberg.kelsey
2019-08-10  7:17 ` Greg KH
2019-08-10  7:17   ` Greg KH
2019-08-10  7:17   ` greg
2019-08-10 17:15   ` Bjorn Helgaas
2019-08-10 17:15     ` Bjorn Helgaas
2019-08-10 17:15     ` helgaas
2019-08-10 17:24     ` Greg KH
2019-08-10 17:24       ` Greg KH
2019-08-10 17:24       ` greg
2019-08-10 21:32       ` Kelsey Skunberg
2019-08-10 21:32         ` Kelsey Skunberg
2019-08-10 21:32         ` skunberg.kelsey
2019-08-13 20:45 ` [PATCH v2 0/3] PCI: pci-sysfs.c cleanup Kelsey Skunberg
2019-08-13 20:45   ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-13 20:45   ` skunberg.kelsey
2019-08-13 20:45   ` [PATCH v2 1/3] PCI: sysfs: Define device attributes with DEVICE_ATTR*() Kelsey Skunberg
2019-08-13 20:45     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-13 20:45     ` skunberg.kelsey
2019-08-14  7:52     ` Greg KH
2019-08-14  7:52       ` Greg KH
2019-08-14  7:52       ` gregkh
2019-08-14 23:14       ` Kelsey Skunberg
2019-08-14 23:14         ` Kelsey Skunberg
2019-08-14 23:14         ` skunberg.kelsey
2019-08-15 15:54       ` Kelsey Skunberg
2019-08-15 15:54         ` Kelsey Skunberg
2019-08-15 15:54         ` skunberg.kelsey
2019-08-13 20:45   ` [PATCH v2 2/3] PCI: sysfs: Change permissions from symbolic to octal Kelsey Skunberg
2019-08-13 20:45     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-13 20:45     ` skunberg.kelsey
2019-08-14  5:38     ` Bjorn Helgaas
2019-08-14  5:38       ` Bjorn Helgaas
2019-08-14  5:38       ` helgaas
2019-08-14  7:53       ` Greg Kroah-Hartman [this message]
2019-08-14  7:53         ` Greg Kroah-Hartman
2019-08-14  7:53         ` gregkh
2019-08-15 14:37       ` Don Dutile
2019-08-15 14:37         ` Don Dutile
2019-08-15 14:37         ` ddutile
2019-09-04  6:22         ` Kelsey Skunberg
2019-09-04  6:22           ` Kelsey Skunberg
2019-09-04  6:22           ` skunberg.kelsey
2019-09-04 15:32           ` Don Dutile
2019-09-04 15:32             ` Don Dutile
2019-09-04 15:32             ` ddutile
2019-09-04 18:33           ` Don Dutile
2019-09-04 18:33             ` Don Dutile
2019-09-04 18:33             ` ddutile
2019-09-05  4:04             ` Kelsey Skunberg
2019-09-05  4:04               ` Kelsey Skunberg
2019-09-05  4:04               ` skunberg.kelsey
2019-08-13 20:45   ` [PATCH v2 3/3] PCI/IOV: Move sysfs SR-IOV functions to iov.c Kelsey Skunberg
2019-08-13 20:45     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-13 20:45     ` skunberg.kelsey
2019-08-14  5:40   ` [Linux-kernel-mentees] [PATCH v2 0/3] PCI: pci-sysfs.c cleanup Bjorn Helgaas
2019-08-14  5:40     ` Bjorn Helgaas
2019-08-14  5:40     ` helgaas
2019-08-15 15:33   ` [PATCH v3 0/4] PCI: Clean up pci-sysfs.c Kelsey Skunberg
2019-08-15 15:33     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-15 15:33     ` skunberg.kelsey
2019-08-15 16:08     ` Greg KH
2019-08-15 16:08       ` [Linux-kernel-mentees] " Greg KH
2019-08-15 16:08       ` gregkh
2019-08-16  4:22     ` Don Dutile
2019-08-16  4:22       ` [Linux-kernel-mentees] " Don Dutile
2019-08-16  4:22       ` ddutile
2019-08-19 22:42     ` Bjorn Helgaas
2019-08-19 22:42       ` Bjorn Helgaas
2019-08-19 22:42       ` helgaas
2019-08-15 15:33   ` [PATCH v3 1/4] PCI: sysfs: Define device attributes with DEVICE_ATTR* Kelsey Skunberg
2019-08-15 15:33     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-15 15:33     ` skunberg.kelsey
2020-03-14 10:51     ` Ruslan Bilovol
2020-03-14 10:51       ` [Linux-kernel-mentees] " Ruslan Bilovol
2020-03-14 11:20       ` Greg Kroah-Hartman
2020-03-14 11:20         ` [Linux-kernel-mentees] " Greg Kroah-Hartman
2020-03-24  6:10         ` Kelsey
2020-03-24  6:10           ` [Linux-kernel-mentees] " Kelsey
2020-03-24  6:24           ` Greg Kroah-Hartman
2020-03-24  6:24             ` [Linux-kernel-mentees] " Greg Kroah-Hartman
2020-03-24 23:53             ` Kelsey
2020-03-24 23:53               ` [Linux-kernel-mentees] " Kelsey
2020-03-25  7:17               ` Greg Kroah-Hartman
2020-03-25  7:17                 ` [Linux-kernel-mentees] " Greg Kroah-Hartman
2020-03-25 15:15                 ` Kelsey
2020-03-25 15:15                   ` [Linux-kernel-mentees] " Kelsey
2019-08-15 15:33   ` [PATCH v3 2/4] PCI: sysfs: Change permissions from symbolic to octal Kelsey Skunberg
2019-08-15 15:33     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-15 15:33     ` skunberg.kelsey
2019-08-15 15:33   ` [PATCH v3 3/4] PCI: sysfs: Change DEVICE_ATTR() to DEVICE_ATTR_WO() Kelsey Skunberg
2019-08-15 15:33     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-15 15:33     ` skunberg.kelsey
2019-08-15 15:33   ` [PATCH v3 4/4] PCI/IOV: Move sysfs SR-IOV functions to iov.c Kelsey Skunberg
2019-08-15 15:33     ` [Linux-kernel-mentees] " Kelsey Skunberg
2019-08-15 15:33     ` skunberg.kelsey
2019-08-15 17:34     ` sathyanarayanan kuppuswamy
2019-08-15 17:34       ` [Linux-kernel-mentees] " sathyanarayanan kuppuswamy
2019-08-15 17:34       ` sathyanarayanan.kuppuswamy

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=20190814075324.GB4067@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=bodong@mellanox.com \
    --cc=ddutile@redhat.com \
    --cc=helgaas@kernel.org \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=skunberg.kelsey@gmail.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.