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.