pdunshare() calls pdescfree(), which stores NULL into p->p_pd, and only
then stores the new pwddesc. pwd_hold_proc() running in that window gets
NULL from pdhold() and dereferences it. pwd_hold_proc() assumed p_pd is
never NULL for a held process.
Close the gap by inlining parts of pdescfree() into pdunshare(), to
avoid temporary storing NULL.
Reported by: llm-postcr
Fixes: 85c855d31b18 ("fd: add pwd_hold_proc")Details
Details
- Reviewers
markj
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped