LKML Archive on
help / color / mirror / Atom feed
From: Lorenzo Pieralisi <>
Cc: Lorenzo Pieralisi <>,
	Arnd Bergmann <>,
	Jesse Barnes <>,
	Bjorn Helgaas <>,
	Benjamin Herrenschmidt <>,
	Russell King <>,
	"David S. Miller" <>,
	Michal Simek <>,
	Martin Wilck <>,
	Linux PCI <>
Subject: [RFC PATCH v3 0/2] Fix procfs PCI resources mmap
Date: Thu, 13 Nov 2014 11:19:14 +0000	[thread overview]
Message-ID: <> (raw)

The way PCI memory resources are exported to user space through procfs
is not uniform across architectures. In particular, some architectures
(ie SPARC) export the resource PCI bus address to user space, whereas
others (ARM, PowerPC, Microblaze) export the resource CPU physical address.
This convention should be followed when it comes to passing the pgoff
values to the mmap syscall to map the resource in question.

Consequently, the checks applied to the offset passed to the mmap syscall
(in pci_mmap_fits()) are to be interpreted differently on different
architectures, and in particular they should match the values exported to
user space through the pci_resource_to_user() conversion function.

This patch series addresses two issues. First patch applies the
pci_resource_to_user() filter to the PCI resource that is being
mapped in order to carry out a proper check against the pgoff passed
from user space. Second patch fixes the way the pgoff is handled in
the ARM pci_mmap_page_range() implementation.

v2 posting:

v2 => v3
- Reworded commit log in order to try to bisect the breakage
  and provide insights into the commit history that led to the
  current interface

v1 => v2
- Reworded commit log as per RMK comments

Lorenzo Pieralisi (2):
  drivers: pci: fix pci_mmap_fits() implementation for procfs mmap
  arm: kernel: fix pci_mmap_page_range() offset calculation

 arch/arm/kernel/bios32.c | 10 ++--------
 drivers/pci/pci-sysfs.c  | 13 ++++++++-----
 2 files changed, 10 insertions(+), 13 deletions(-)


             reply	other threads:[~2014-11-13 11:19 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-13 11:19 Lorenzo Pieralisi [this message]
2014-11-13 11:19 ` [RFC PATCH v3 1/2] drivers: pci: fix pci_mmap_fits() implementation for procfs mmap Lorenzo Pieralisi
2014-11-21 17:51   ` Bjorn Helgaas
2014-11-25 10:03     ` Lorenzo Pieralisi
2014-11-25 23:10     ` Benjamin Herrenschmidt
2015-01-21 18:44     ` Lorenzo Pieralisi
2015-01-23 23:58       ` Bjorn Helgaas
2014-11-13 11:19 ` [RFC PATCH v3 2/2] arm: kernel: fix pci_mmap_page_range() offset calculation Lorenzo Pieralisi
2015-01-23 23:59   ` Bjorn Helgaas
2015-01-26  9:57     ` Lorenzo Pieralisi
2014-11-19  9:57 ` [RFC PATCH v3 0/2] Fix procfs PCI resources mmap Lorenzo Pieralisi

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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \ \ \ \ \ \ \ \
    --subject='Re: [RFC PATCH v3 0/2] Fix procfs PCI resources mmap' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).