]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/commit
MFC r361075:
authorhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 22 May 2020 09:02:40 +0000 (09:02 +0000)
committerhselasky <hselasky@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 22 May 2020 09:02:40 +0000 (09:02 +0000)
commita61a584a5fdbc5be40f0690213d0fa938e2a9ade
treec3c5b803d60f4591fe84320656c65eaed63175b0
parent5721ee1eed88572731f57ad1c8a6f640b3004d5a
MFC r361075:
Assign process group of the TTY under the "proctree_lock".

This fixes a race where concurrent calls to doenterpgrp() and
leavepgrp() while TIOCSCTTY is executing may result in tp->t_pgrp
changing value so that tty_rel_pgrp() misses clearing it to NULL. For
more details refer to the use of pgdelete() in the kernel.

No functional change intended.

Panic backtrace:
__mtx_lock_sleep() # page fault due to using destroyed mutex
tty_signal_pgrp()
tty_ioctl()
ptsdev_ioctl()
kern_ioctl()
sys_ioctl()
amd64_syscall()

Sponsored by: Mellanox Technologies

git-svn-id: svn://svn.freebsd.org/base/stable/9@361359 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/kern/tty.c