]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
osd: Fix racy assertions
authorMark Johnston <markj@FreeBSD.org>
Thu, 9 Sep 2021 13:50:27 +0000 (09:50 -0400)
committerMark Johnston <markj@FreeBSD.org>
Thu, 9 Sep 2021 14:11:02 +0000 (10:11 -0400)
commit187afc58791cd877c8ba0573b7826c31db8c6f73
treedc8e9f1c946f3e10cc1fef3676f374ae4f861ec3
parentb645ee1815daf96ee9512633b55c423bc897b244
osd: Fix racy assertions

osd_register(9) may reallocate and expand the destructor array for a
given object type if no space is available for a new key.  This happens
with the object lock held.  Thus, when verifying that a given slot in
the array is occupied, we need to hold the object lock to avoid racing
with a reallocation.

Reported by: syzbot+69ce54c7d7d813315dd3@syzkaller.appspotmail.com
MFC after: 1 week
Sponsored by: The FreeBSD Foundation
sys/kern/kern_osd.c