]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
select: make sure there are no wakeup attempts after selfdfree returns
authormjg <mjg@FreeBSD.org>
Wed, 2 Dec 2020 00:48:15 +0000 (00:48 +0000)
committermjg <mjg@FreeBSD.org>
Wed, 2 Dec 2020 00:48:15 +0000 (00:48 +0000)
commit0b8a3b07cd1a66b22cf5a5de5649d11efa8012b3
treedf450b5da882ab9ab2dab145940e3892744488ef
parentf56a1ed936d4f0098d22744958c222db61f3785a
select: make sure there are no wakeup attempts after selfdfree returns

Prior to the patch returning selfdfree could still be racing against doselwakeup
which set sf_si = NULL and now locks stp to wake up the other thread.

A sufficiently unlucky pair can end up going all the way down to freeing
select-related structures before the lock/wakeup/unlock finishes.

This started manifesting itself as crashes since select data started getting
freed in r367714.
sys/kern/sys_generic.c