The following commit has been merged in the master branch:
commit 132268042d1992d39614e72d67957b2b10ebfba6
Author: Jeffrey Altman <[email protected]>
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 <[email protected]>
    Tested-by: Asanka Herath <[email protected]>
    Reviewed-by: Asanka Herath <[email protected]>
    Tested-by: Jeffrey Altman <[email protected]>
    Reviewed-by: Jeffrey Altman <[email protected]>

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

-- 
OpenAFS Master Repository
_______________________________________________
OpenAFS-cvs mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-cvs

Reply via email to