diff options
Diffstat (limited to 'usr/src')
-rw-r--r-- | usr/src/uts/common/fs/smbsrv/smb2_read.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/usr/src/uts/common/fs/smbsrv/smb2_read.c b/usr/src/uts/common/fs/smbsrv/smb2_read.c index f8c91c878f..936fa06f6c 100644 --- a/usr/src/uts/common/fs/smbsrv/smb2_read.c +++ b/usr/src/uts/common/fs/smbsrv/smb2_read.c @@ -10,11 +10,12 @@ */ /* - * Copyright 2019 Nexenta Systems, Inc. All rights reserved. + * Copyright 2020 Tintri by DDN, Inc. All rights reserved. */ /* * Dispatch function for SMB2_READ + * MS-SMB2 sec. 3.3.5.12 */ #include <smbsrv/smb2_kproto.h> @@ -160,6 +161,14 @@ smb2_read(smb_request_t *sr) MBC_ATTACH_MBUF(&sr->raw_data, m); /* + * [MS-SMB2] If the read returns fewer bytes than specified by + * the MinimumCount field of the request, the server MUST fail + * the request with STATUS_END_OF_FILE + */ + if (status == 0 && XferCount < MinCount) + status = NT_STATUS_END_OF_FILE; + + /* * Checking the error return _after_ dealing with * the returned data so that if m was allocated, * it will be free'd via sr->raw_data cleanup. |