Patching until the COWs come home (part 1)
Patching until the COWs come home (part 1)
Posted Mar 23, 2021 16:00 UTC (Tue) by iabervon (subscriber, #722)In reply to: Patching until the COWs come home (part 1) by milesrout
Parent article: Patching until the COWs come home (part 1)
The PTE has to go away because that's what munmap() is specified to do. Furthermore, the fact that it's the same process at both ends of the pipe is irrelevant to the issue, I think. It seems to me like the simple solution would be to elevate the page map count while it's in the pipe (but where else might a page be kept that a process other than parent could get it?) or use the refcount to decide if the parent is the exclusive owner (but maybe the parent has extra references?).
I think the semantics that would be clear is that, if a reference can be used to read the contents of the page, or can be converted into a reference that can be used to read the contents of the page, it counts as a map. But then you'd have to identify what needs the addition.