On Fri, Feb 7, 2025 at 6:51 PM Samuel Thibault <samuel.thiba...@gnu.org> wrote: > Yuqian Yang, le ven. 07 févr. 2025 23:27:01 +0800, a ecrit: > > I know this is due to the way of our kernel to handle file and memory. > > Do we have a good way to fix this, > > Not a trivial way. It'd need adding names to the kernel map entries, and > setting them from mmap() and such functions that map files into memory.
I actually had an idea at some point about how this could be done in a more proper (if significantly more involved) way: we'd extend the pager interface (could be a separate subsystem) with an RPC that would reify the VM object back into a file_t (the inverse to io_map), likely opened with O_NORW. Coupled with a better way to extract paths from a file port, we could make procfs (and gdb etc) generate these path entries, with full correctness in the face of namespaces/chroots. This would probably need a proxy RPC on Mach side, side we cannot get the pager port directly from userland. Sergey