HomeFreeBSD

pgrp: Prevent use after free.

Description

pgrp: Prevent use after free.

Often, we have a process locked and need to get locked process group.
In this case, because progress group lock is before process lock,
unlocking process allows the group to be freed. See for instance
tty_wait_background().

Make pgrp structures allocated from nofree zone, and ensure type stability
of the pgrp mutex.

Reviewed by: jilles
Tested by: pho
MFC after: 2 weeks
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D27871

Details

Provenance
kibAuthored on Dec 31 2020, 1:44 PM
Reviewer
jilles
Differential Revision
D27871: Rework jobc handling.
Parents
rGe0d83cd3e49f: issignal(): when handling STOP-like signals, drop sigacts mutex earlier.
Branches
Unknown
Tags
Unknown