OpenAFS CVS Commit: openafs/src/WINNT/afsd by jaltman

cvs@GRAND.CENTRAL.ORG cvs@GRAND.CENTRAL.ORG
Fri, 22 Aug 2008 18:19:32 EDT


Update of /cvs/openafs/src/WINNT/afsd
In directory GRAND.CENTRAL.ORG:/home/jaltman/openafs/cvs-kdfs/src/WINNT/afsd

Modified Files:
      Tag: openafs-windows-kdfs-ifs-branch
	afsd_init.c afsd_service.c cm.h cm_access.c cm_aclent.c 
	cm_buf.c cm_callback.c cm_cell.c cm_cell.h cm_conn.c 
	cm_daemon.c cm_dcache.c cm_dnlc.c cm_freelance.c cm_ioctl.c 
	cm_rpc.c cm_scache.c cm_server.c cm_user.c cm_utils.c 
	cm_vnodeops.c cm_volume.c smb.c smb.h smb3.c 
Log Message:
DELTA KDFS-windows-misc-20080822
AUTHOR jaltman@secure-endpoints.com
LICENSE MIT

1. In multi-threaded applications deadlocking is always a problem.
Deadlock avoidance requires a strict adherence to a documented
hierarchy.  The lock hierarchy for OAFW is described in a file
called locks.txt.  There are two problems.  First, some of the
locks are not included in locks.txt.  Second, it is nearly
impossible given the depth of function calls for any programmer
 to identify all of the locks that are held at any given time
a function is called.  This patch implements a new locking order
verification mechanism.  Each lock is assigned a lock level at
initialization.  Each thread maintains a queue of held locks.
Each time a lock is acquired the queue is checked to ensure that
no locks with a higher level than the requested lock has already
been acquired.  If a violation occurs, the service panics.

2. When the service panics ensure that a minidump will always be generated.

3. Remove unused lock cm_bufGetMutex.

4. The lock order verifier identified approximately a dozen
lock order violations that are corrected.

5. A race condition within the function path cm_GetSCache() ->
cm_GetNewSCache() -> cm_RecycleSCache() permitted a cm_scache_t
object to be issued simultaneously to two threads.  This would
eventually result in a panic due to the resulting under count.

6. Fix interpretation of the empty string as the ioctl path to
mean the current directory.   "fs lsm", "symlink list", etc.
now return a "not a ..." error instead of "does not exist".

7. Add SMB_STRF_SRCNULTERM flag to smb_ParseStringXXX functions
to indicate that the input string is a nul terminated string.
Assign it when input strings are nul terminated.

8. The CIFS protocol specification for handling NT_TRANSACT_CREATE
does not match the observed behavior.  The 'nameLength' is specified
in bytes not in characters.  Fix the implementation to match.

9. The cm_HaveAccessRights() attempt at deadlock avoidance by calling
lock_TryRead() on the parent directory cm_scache_t rw-lock does not
avoid the deadlock.  Avoid the deadlock by enforcing the lock order
of lowest vnode first.  Then remove the infinite loop avoidance in
cm_SyncOp() that was returning an unwarranted access denied error.


--- DELTA config for openafs-windows-kdfs-ifs-branch follows ---
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/afsd_init.c 1.117.2.8 1.117.2.9
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/afsd_service.c 1.76.2.5 1.76.2.6
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm.h 1.31.2.2 1.31.2.3
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_access.c 1.26.2.2 1.26.2.3
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_aclent.c 1.19.2.1 1.19.2.2
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_buf.c 1.68.2.7 1.68.2.8
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_callback.c 1.82.2.6 1.82.2.7
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_cell.c 1.37.2.4 1.37.2.5
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_cell.h 1.15 1.15.2.1
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_conn.c 1.89.2.7 1.89.2.8
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_daemon.c 1.45 1.45.2.1
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_dcache.c 1.61.2.2 1.61.2.3
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_dnlc.c 1.17.2.2 1.17.2.3
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_freelance.c 1.43.2.6 1.43.2.7
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_ioctl.c 1.113.2.16 1.113.2.17
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_rpc.c 1.8 1.8.10.1
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_scache.c 1.105.2.13 1.105.2.14
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_server.c 1.54.2.2 1.54.2.3
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_user.c 1.13.2.1 1.13.2.2
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_utils.c 1.19.2.5 1.19.2.6
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_vnodeops.c 1.141.2.16 1.141.2.17
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/cm_volume.c 1.50.2.13 1.50.2.14
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/smb.c 1.191.2.23 1.191.2.24
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/smb.h 1.69.2.8 1.69.2.9
KDFS-windows-misc-20080822 openafs/src/WINNT/afsd/smb3.c 1.154.2.15 1.154.2.16