HomeFreeBSD

proc: fix a race which could result in dereference of bad p_pgrp pointer on fork

Description

proc: fix a race which could result in dereference of bad p_pgrp pointer on fork

During fork p_starcopy - p_endcopy area of a process is populated with bcopy
with only proc lock held. Another forking thread can find such a process and
proceed to access p_pgrp included in said area.

Fix the problem by moving the field outside. It is being properly assigned
later.

Reviewed by: kib
Diagnosed by: kib
Tested by: Fabian Keil <freebsd-listen fabiankeil.de>
MFC after: 10 days

Details

Provenance
mjgAuthored on
Reviewer
kib
Parents
rS292439: MFC r291156:
Branches
Unknown
Tags
Unknown