windows-smb-fidp-scp-race-20090212
authorJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 12 Feb 2009 21:44:47 +0000 (21:44 +0000)
committerJeffrey Altman <jaltman@secure-endpoints.com>
Thu, 12 Feb 2009 21:44:47 +0000 (21:44 +0000)
commit8e3b67b9537097928b4fc13844db09d429ac9bed
tree5cc84508da011c3bf9c76e06d62a3db00ac04b8e
parent8bb35234aa8469ba93a2171fced503a875c2f1f6
windows-smb-fidp-scp-race-20090212

LICENSE MIT
FIXES 124293

As evident in a crash dump, there is a race surrounding access to the
scp field of the smb_fid_t object.  Not all access was protected by
the smb_fid_t mx and the cm_scache_t object was not always being
reference counted within the accessing function.

This patch ensures that all initial references to the scp object
are performed under the smb_fid_t mx mutex and that the cm_scache_t
is prevented from being recycled by obtaining a local reference.

Finally, CM_ERROR_BADFD is returned as an error if a request begins
after the smb_fid_t scp field has already been cleared by a smb_CloseFID()
call as part of a concurrent request.
src/WINNT/afsd/smb.c
src/WINNT/afsd/smb3.c