]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Fix an LLE lookup race.
authorMark Johnston <markj@FreeBSD.org>
Wed, 23 Jan 2019 22:18:23 +0000 (22:18 +0000)
committerMark Johnston <markj@FreeBSD.org>
Wed, 23 Jan 2019 22:18:23 +0000 (22:18 +0000)
commitc06cc56e3940ef36bca0f9163decf258766b52e2
tree94b6d41426a77a1491ec566302af9bd740dbcd1e
parentb29e142648453f93bea592b5379ae141137397ee
Fix an LLE lookup race.

After the afdata read lock was converted to epoch(9), readers could
observe a linked LLE and block on the LLE while a thread was
unlinking the LLE.  The writer would then release the lock and schedule
the LLE for deferred free, allowing readers to continue and potentially
schedule the LLE timer.  By the point the timer fires, the structure is
freed, typically resulting in a crash in the callout subsystem.

Fix the problem by modifying the lookup path to check for the LLE_LINKED
flag upon acquiring the LLE lock.  If it's not set, the lookup fails.

PR: 234296
Reviewed by: bz
Tested by: sbruno, Victor <chernov_victor@list.ru>,
Mike Andrews <mandrews@bit0.com>
MFC after: 3 days
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D18906
sys/netinet/in.c
sys/netinet6/in6.c