v2
2026-07-31
移除文件时解除mmap映射 · v2
修复PCI BARs用户空间映射在设备移除后未撤销,添加unmap_mapping_file()并应用于kernfs/procfs。
原始补丁链接
子 Patch(3)
1/3
mm: Add unmap_mapping_file() helper
Currently, unmap_mapping_pages() and unmap_mapping_range() unmap a page offset window of an address_space, and code that removes a file, such as kernfs_drain_open_files(), relies on them to unmap the
2/3
kernfs: Unmap mmaps of removed files via file->f_mapping
Currently, kernfs_drain_open_files() unmaps the mapping of the sysfs inode, file_inode(of->file)->i_mapping, when a node with mmapped open files is removed. Since commit 636b21b50152 (“PCI: Revoke ma
3/3
proc: Unmap mmaps of removed files via file->f_mapping
Currently, proc_entry_rundown() releases every open file of an entry that is being removed, but never unmaps the userspace mappings created through those files, so these stay in place after the entry