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 for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <fe4f2460f9454483bb18a64c1314c950@FE-MBX1012.de.bosch.com>
Date:	Tue, 7 Jun 2016 06:51:47 +0000
From:	"Koehrer Mathias (ETAS/ESW5)" <mathias.koehrer@...s.com>
To:	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:	"linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	"bhelgaas@...gle.com" <bhelgaas@...gle.com>,
	"hjk@...sjkoch.de" <hjk@...sjkoch.de>
Subject: Re: [PATCH] Introducing kernel option to force all PCI memory
 resources to be page aligned. Fixes issues with uio based drivers.

Hi Greg,
> > thanks for the response.
> > > > Some uio based PCI drivers (e.g. uio_cif) do not work if the
> > > > assigned PCI memory resources are not page aligned.
> > > > By using the kernel option "pci=resource_alignment" it is possible
> > > > to force single PCI boards to use page alignment for their memory
> resources.
> > > > However, this is fairly cumbersome if multiple of these cards are in use.
> > > > This patch adds another kernel option "pci=resources_page_aligned"
> > > > that allows to set the default alignment of PCI memory resources
> > > > to be page aligned.
> > > > Overwriting of this default alignment via "pci=resource_alignment"
> > > > is still possible.
> > >
> > > This seems like a very large hammer for a very specific problem with
> > > a card that seems to be not-in-spec (I can't find anywhere that
> > > requires resources to be "page" aligned in the PCI spec).  Why not fix the
> firmware in these cards?
> > The issue is not the firmware. The issue is that the Linux uio driver
> > (here: uio_cif) does not work as uio_mmap() -> uio_mmap_physical()
> > does not do a mmap on physical memory that is not page aligned...
> 
> Then why not fix the uio_cif driver?
The fix might be in uio and not in uio_cif. However uio_mmap_physical() in
uio.c has introduced checks to reject non page-aligned addresses.
These checks have been introduced somewhere in between kernel V3.2 and kernel V3.18. 
Removing these checks again does not sound to me like a good idea...
The overall question is now if the UIO system is working at all with non page 
aligned PCI memory resources. For me it looks as if this is not the case.
E.g. with the boards supported with the uio_cif driver, the memory resource 2 of the
PCI device is a 128 byte memory. And exactly this memory has to be mmaped by the
driver and this fails.
As the uio driver do (no longer) work with non page aligned PCI memory resources,
the conclusion for me is to force the relevant PCI memory resources to be page aligned.
And that's why the patch might be used for.

Regards

Mathias




Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ