archive mirror
 help / color / mirror / Atom feed
From: "Krzysztof Wilczyński" <>
To: Bjorn Helgaas <>
Cc: "Slivka, Danijel" <>,
	"" <>,
	"" <>
Subject: Re: [PATCH] PCI: Fix accessing freed memory in pci_remove_resource_files
Date: Thu, 3 Jun 2021 20:37:57 +0200	[thread overview]
Message-ID: <20210603183757.GB375714@rocinante.localdomain> (raw)
In-Reply-To: <20210525225445.GA108348@rocinante.localdomain>


> Having said that, aside of some dependency Alpha has on the functions we
> are trying to retire, both of them have a larger challenge to overcome,
> and which is related to the following commits:
> - 3234ac664a87 ("/dev/mem: Revoke mappings when a driver claims the region")
> - 636b21b50152 ("PCI: Revoke mappings like devmem")
> Following these two changes, functions pci_create_attr() (called internally
> from the pci_create_resource_files()) and pci_create_legacy_files() have
> since a dependency on the iomem_get_mapping() function - which in turn also
> creates an implicit dependency on the VFS and fs_initcall.
> This dependency on iomem_get_mapping() stops us from retiring the
> late_initcall at the moment as when we convert dynamically added sysfs
> objects (that are primarily added in the pci_create_resource_files() and
> pci_create_legacy_files() functions), these attributes are added before
> the VFS completes its initialisation, and since most of the PCI devices
> are typically enumerated in subsys_initcall this leads to a failure and
> an Oops related to iomem_get_mapping() access.
> See relevant conversations:
> After some deliberation on a potential solution, we have settled on
> changing the order when PCI sub-system and relevant device drivers are
> initialised so that PCI will come after the VFS but before ACPI, thus
> allowing for the iomem_get_mapping() to work without issues.

The conversation related to the iomem_get_mapping() and the dependency
on VFS has moved to the following thread:


  reply	other threads:[~2021-06-03 18:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 10:27 [PATCH] PCI: Fix accessing freed memory in pci_remove_resource_files Danijel Slivka
2021-05-07 22:07 ` Bjorn Helgaas
2021-05-10 15:02   ` Slivka, Danijel
2021-05-10 22:57     ` Bjorn Helgaas
2021-05-25 22:54       ` Krzysztof Wilczyński
2021-06-03 18:37         ` Krzysztof Wilczyński [this message]
2021-10-26 22:12       ` Bjorn Helgaas
2021-05-10 15:08   ` Slivka, Danijel

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 \
    --in-reply-to=20210603183757.GB375714@rocinante.localdomain \ \ \ \ \ \

* 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 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).