Re: [PATCH] PCI: Fix accessing freed memory in pci_remove_resource_files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

[...]
> 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:
> 
>   https://lore.kernel.org/linux-pci/20210204165831.2703772-1-daniel.vetter@xxxxxxxx/
>   https://lore.kernel.org/linux-pci/20210313215747.GA2394467@bjorn-Precision-5520/
> 
> 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:

  https://lore.kernel.org/linux-pci/20210527205845.GA1421476@bjorn-Precision-5520/

	Krzysztof



[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux