OpenAFS Master Repository branch, master, updated. openafs-devel-1_5_62-31-g1322680

Gerrit Code Review gerrit@openafs.org
Tue, 8 Sep 2009 10:15:14 -0700 (PDT)


The following commit has been merged in the master branch:
commit 132268042d1992d39614e72d67957b2b10ebfba6
Author: Jeffrey Altman <jaltman@secure-endpoints.com>
Date:   Sun Sep 6 14:45:42 2009 -0400

    Windows: Prevent simultaneous pioctls
    
    The Windows pioctl implementation makes an incorrect assumption.
    It is not true that every CreateFile() operation results in a
    SMB NTCreateX operation being delivered to SMB Server.  The SMB
    client can combine open requests from multiple processes or threads
    onto a single SMB file descriptor and locally manage the operations.
    This is a problem for pioctls since the Transceive operation requires
    that a WriteFile/ReadFile combination must belong to the same request.
    
    Prior to this change simultaneous pioctl operations would be
    combined and the individual reads and writes could overlap resulting
    in responses going to the wrong requestor and end of file errors
    being received by the others.
    
    Due to lack of data validation in fs.c, ktc_nt.c, symlink.c,
    etc random crashes are produced.
    
    This change alters the sharing mode under which the pioctl file is
    opened.  Instead of FILE_SHARE_READ | FILE_SHARE_WRITE, only
    FILE_SHARE_READ is specified to CreateFile().  This ensures that
    the CreateFile will fail with a sharing violation if the pioctl
    file was previously opened for writing.
    
    A sharing violation check is provided and the CreateFile is retried
    indefinitely until the open succeeds or the error is not a sharing
    violation.
    
    LICENSE MIT
    
    Reviewed-on: http://gerrit.openafs.org/404
    Reviewed-by: Derrick Brashear <shadow@dementia.org>
    Tested-by: Asanka Herath <asanka@secure-endpoints.com>
    Reviewed-by: Asanka Herath <asanka@secure-endpoints.com>
    Tested-by: Jeffrey Altman <jaltman@openafs.org>
    Reviewed-by: Jeffrey Altman <jaltman@openafs.org>

 src/sys/pioctl_nt.c |   52 +++++++++++++++++++++++++++++++++++++-------------
 1 files changed, 38 insertions(+), 14 deletions(-)

-- 
OpenAFS Master Repository