lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240212152959.GB16050@unreal>
Date: Mon, 12 Feb 2024 17:29:59 +0200
From: Leon Romanovsky <leonro@...dia.com>
To: Keith Busch <kbusch@...nel.org>
CC: Kuppuswamy Sathyanarayanan <sathyanarayanan.kuppuswamy@...ux.intel.com>,
	Jim Harris <jim.harris@...sung.com>, Bjorn Helgaas <bhelgaas@...gle.com>,
	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Jason
 Gunthorpe" <jgg@...dia.com>, Alex Williamson <alex.williamson@...hat.com>,
	"pierre.cregut@...nge.com" <pierre.cregut@...nge.com>
Subject: Re: [PATCH v2 2/2] pci/iov: fix kobject_uevent() ordering in
 sriov_enable()

On Mon, Feb 12, 2024 at 08:17:58AM -0700, Keith Busch wrote:
> On Fri, Feb 09, 2024 at 07:22:17PM -0800, Kuppuswamy Sathyanarayanan wrote:
> > On 2/9/24 3:52 PM, Jim Harris wrote:
> > > @@ -677,8 +677,8 @@ static int sriov_enable(struct pci_dev *dev, int nr_virtfn)
> > >  	if (rc)
> > >  		goto err_pcibios;
> > >  
> > > -	kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE);
> > >  	iov->num_VFs = nr_virtfn;
> > > +	kobject_uevent(&dev->dev.kobj, KOBJ_CHANGE);
> 
> Since it's accessed unlocked now, I *think* this wants appropriate
> barriers to ensure the order is observed the same on all CPUs. Something
> like 'smp_store_release(&iov->num_VFs, nr_virtfn)' for writing it, and
> use 'smp_load_acquire()' on the read-side.

It is unlocked only for sysfs read. IMHO it is overkill to use stores
for this case.

Thanks

> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ