HomeFreeBSD

amd64: Fix propagation of LDT updates

Description

amd64: Fix propagation of LDT updates

When a process has used sysarch(2) to specify descriptors for its
private LDT, upon rfork(RFMEM) descriptors are copied into the new child
process. Any updates to the descriptors are thus reflected to all other
processes sharing the vmspace. However, this is incorrect in the rather
obscure case where the child process was created before the LDT was
modified. Fix this by only modifying other processes which already
share the LDT.

Reported by: syzkaller
Reviewed by: kib
Sponsored by: The FreeBSD Foundation

(cherry picked from commit 70dd5eebc025badb7b835dfee3915d8b5f1e7468)

Details

Provenance
markjAuthored on Jun 14 2021, 9:32 PM
Parents
rG659f77766031: cpucontrol: fix extended signature matching code to avoid fallthough
Branches
Unknown
Tags
Unknown