]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
select: make sure there are no wakeup attempts after selfdfree returns
authorMateusz Guzik <mjg@FreeBSD.org>
Wed, 2 Dec 2020 00:48:15 +0000 (00:48 +0000)
committerMateusz Guzik <mjg@FreeBSD.org>
Wed, 2 Dec 2020 00:48:15 +0000 (00:48 +0000)
commit10e64782ed59727e8c9fe4a5c7e17f497903c8eb
treedf450b5da882ab9ab2dab145940e3892744488ef
parent013a1ae66e1fc13cdc3277a008fc499f9fc10970
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