Page MenuHomeFreeBSD

use crcopysafe(9) to update a process' credential in sys_cap_enter()
ClosedPublic

Authored by markj on Jan 5 2015, 10:12 PM.
Tags
None
Referenced Files
F101378131: D1443.diff
Mon, Oct 28, 4:19 PM
Unknown Object (File)
Sep 26 2024, 8:41 PM
Unknown Object (File)
Sep 18 2024, 10:08 PM
Unknown Object (File)
Sep 13 2024, 6:06 AM
Unknown Object (File)
Sep 8 2024, 8:17 PM
Unknown Object (File)
Sep 8 2024, 1:57 PM
Unknown Object (File)
Sep 8 2024, 1:19 AM
Unknown Object (File)
Sep 2 2024, 12:30 AM
Subscribers
None

Details

Summary

At the moment, sys_cap_enter() uses crcopy(9) to make a copy of a process' credential struct; it sets a flag on the copy and updates the process' p_ucred to point to the new copy. All of this is done while the corresponding proc lock is held.

crcopy(9) potentially performs an M_WAITOK allocation, which is not allowed when a mutex is held. This change modifies sys_cap_enter() to use crcopysafe(9) instead, since it's designed to avoid this problem.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
No Lint Coverage
Unit
No Test Coverage

Event Timeline

markj retitled this revision from to use crcopysafe(9) to update a process' credential in sys_cap_enter().
markj updated this object.
markj edited the test plan for this revision. (Show Details)
markj added reviewers: capsicum, rwatson.
markj updated this revision to Diff 3007.

Closed by commit rS276727 (authored by @markj).