Skip to content

Resource Monitor: narrow PID-reuse kill-safety edge (unreadable recycled root with readable child) #543

Description

@mblua

Follow-up to #516.

Context

#516 added a root-PID-reuse guard in observe_tree/build_observed_tree (src-tauri/src/resource_monitor/windows.rs): when the live process at a group's registered root PID has a creation time that differs from the expected root_identity, the subtree is dropped (so a recycled root PID can't be adopted and later killed). This closed the common readable-foreign-root case.

Remaining narrow edge

If a recycled root PID is occupied by a foreign process whose own identity is UNREADABLE (creation_time == 0 → the new guard is skipped, kill_allowed=false for that node), but that foreign process has a READABLE child, the child is still walked and can get kill_allowed=true. A later kill could then terminate the foreign child.

This was fully open before #516 and is now strictly narrower (the common case is caught). It requires an unlikely combination: same-user PID reuse + unreadable foreign parent + readable foreign child + a kill trigger.

Possible fix direction

Extend the guard so a creation-time-unverifiable root also drops/quarantines its subtree (treat an unreadable root as "do not adopt descendants"), matching the strictness applied to the mismatched-root case.

Severity: LOW, pre-existing, narrow. Identified during #516 adversarial review.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions