Hans Petter Selasky 160c25d031 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()

MFC after:	1 week
Sponsored by:	Mellanox Technologies
2020-05-15 12:47:39 +00:00
..
2020-04-24 01:27:25 +00:00
2020-05-13 07:49:12 +00:00
2020-05-11 22:08:08 +00:00
2020-05-13 18:35:02 +00:00
2020-05-13 19:17:28 +00:00
2020-04-14 18:57:00 +00:00
2020-05-14 17:56:44 +00:00
2020-04-23 09:37:22 +00:00
2020-05-14 16:06:54 +00:00
2020-02-03 17:35:11 +00:00