diff options
author | bde <bde@FreeBSD.org> | 2007-08-31 22:29:55 +0000 |
---|---|---|
committer | bde <bde@FreeBSD.org> | 2007-08-31 22:29:55 +0000 |
commit | 8e0e951bed5e4aefe5928b2fa0f991cbb998bcc4 (patch) | |
tree | f5440eec62960c3e8268bb1b79269753674ca98e /usr.bin/top/top.local.1 | |
parent | 2a6e4ac2ba27fbab6ef5b6b2c962a2bbcc6299aa (diff) | |
download | FreeBSD-src-8e0e951bed5e4aefe5928b2fa0f991cbb998bcc4.zip FreeBSD-src-8e0e951bed5e4aefe5928b2fa0f991cbb998bcc4.tar.gz |
Fix races in msdosfs_lookup() and msdosfs_readdir(). These functions
can easily block in bread(), and then there was nothing to prevent the
static buffer (nambuf_{ptr,len,last_id}) being clobbered by another
thread.
The effects of the bug seem to have been limited to failed lookups and
mangled names in readdir(), since Giant locking provides enough
serialization to prevent concurrent calls to the functions that access
the buffer. They were very obvious for multiple concurrent tree walks,
especially with a small cluster size.
The bug was introduced in msdosfs_conv.c 1.34 and associated changes,
and is in all releases starting with 5.2.
The fix is to allocate the buffer as a local variable and pass around
pointers to it like "_r" functions in libc do. Stack use from this
is large but not too large. This also fixes a memory leak on module
unload.
Reviewed by: kib
Approved by: re (kensmith)
Diffstat (limited to 'usr.bin/top/top.local.1')
0 files changed, 0 insertions, 0 deletions