[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20241122194306.GC160612@unreal>
Date: Fri, 22 Nov 2024 21:43:06 +0200
From: Leon Romanovsky <leon@...nel.org>
To: Bjorn Helgaas <helgaas@...nel.org>
Cc: Jean Delvare <jdelvare@...e.de>,
Krzysztof Wilczyński <kw@...ux.com>,
linux-pci@...r.kernel.org, Ariel Almog <ariela@...dia.com>,
Aditya Prabhune <aprabhune@...dia.com>,
Hannes Reinecke <hare@...e.de>,
Heiner Kallweit <hkallweit1@...il.com>,
Arun Easi <aeasi@...vell.com>, Jonathan Chocron <jonnyc@...zon.com>,
Bert Kenward <bkenward@...arflare.com>,
Matt Carlson <mcarlson@...adcom.com>,
Kai-Heng Feng <kai.heng.feng@...onical.com>,
Alex Williamson <alex.williamson@...hat.com>,
linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
Jakub Kicinski <kuba@...nel.org>,
Thomas Weißschuh <linux@...ssschuh.net>,
Stephen Hemminger <stephen@...workplumber.org>
Subject: Re: [PATCH v2] PCI/sysfs: Change read permissions for VPD attributes
On Thu, Nov 21, 2024 at 04:41:42PM -0600, Bjorn Helgaas wrote:
> On Thu, Nov 21, 2024 at 02:13:01PM +0200, Leon Romanovsky wrote:
> > On Thu, Nov 21, 2024 at 01:01:27PM +0100, Jean Delvare wrote:
> > > On Wed, 13 Nov 2024 14:59:58 +0200, Leon Romanovsky wrote:
> > > > --- a/drivers/pci/vpd.c
> > > > +++ b/drivers/pci/vpd.c
> > > > @@ -332,6 +332,14 @@ static umode_t vpd_attr_is_visible(struct kobject *kobj,
> > > > if (!pdev->vpd.cap)
> > > > return 0;
> > > >
> > > > + /*
> > > > + * Mellanox devices have implementation that allows VPD read by
> > > > + * unprivileged users, so just add needed bits to allow read.
> > > > + */
> > > > + WARN_ON_ONCE(a->attr.mode != 0600);
> > > > + if (unlikely(pdev->vendor == PCI_VENDOR_ID_MELLANOX))
> > > > + return a->attr.mode + 0044;
> > ...
>
> > I still didn't lost hope that at some point VPD will be open for read to
> > all kernel devices.
> >
> > Bjorn, are you ok with this patch? If yes, I'll resend the patch with
> > the suggested change after the merge window.
>
> Reading VPD is a fairly complicated dance that only works if the VPD
> data is well-formatted, and the benefit of unprivileged access seems
> pretty small, so the risk/reward tradeoff for making it unprivileged
> for all devices doesn't seem favorable in my mind.
>
> This quirk seems like the least bad option, so I guess I'm ok with it.
Thanks a lot.
>
> Bjorn
Powered by blists - more mailing lists