Fix a race in rename when relocking the source namecache entry. Since we
authorMatthew Dillon <dillon@dragonflybsd.org>
Sun, 14 Aug 2005 18:41:13 +0000 (18:41 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Sun, 14 Aug 2005 18:41:13 +0000 (18:41 +0000)
commitaa40af332718cdda5e28a028a5de8f7ad093a19d
treef7e93483b8d3ab66c3e66e13489b698544683fd5
parentb45c51398d2d943380168e0171acbe3e73e24146
Fix a race in rename when relocking the source namecache entry.  Since we
may have blocked previously it is possible for the namecache entry to become
invalid (not destroyed since we hold a ref, but invalid).  For example, if
the source was removed.  This case only occurs when rename() is racing
against a remove() or another rename that is overwriting the target that
represents our 'from' name.

The race resulted in a NULL pointer dereference.

Reported-by: =?ISO-8859-2?Q?Toma=BE_Bor=B9tnar?= <tomaz.borstnar@amis.net>
sys/kern/vfs_syscalls.c