Lines Matching full:smb
7 * Contains the routines for constructing the SMB PDUs themselves
11 /* SMB/CIFS PDU handling routines here - except for leftovers in connect.c */
69 /* reconnect the socket, tcon, and smb session if needed */
79 * tcp and smb session status done differently for those three - in the in cifs_reconnect_tcon()
139 * reconnect the same SMB session in cifs_reconnect_tcon()
222 /* Allocate and return pointer to an SMB request buffer, and set basic
223 SMB information in the SMB header. If the return code is zero, this
287 /* potential retries of smb operations it turns out we can determine */ in __smb_init()
339 /* check for parm and data offset going beyond end of smb */ in validate_t2()
349 * less than negotiated smb buffer in validate_t2()
358 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB, in validate_t2()
591 ECHO_REQ *smb; in CIFSSMBEcho() local
599 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); in CIFSSMBEcho()
604 smb->hdr.Flags2 |= SMBFLG2_UNICODE; in CIFSSMBEcho()
607 smb->hdr.Tid = 0xffff; in CIFSSMBEcho()
608 smb->hdr.WordCount = 1; in CIFSSMBEcho()
609 put_unaligned_le16(1, &smb->EchoCount); in CIFSSMBEcho()
610 put_bcc(1, &smb->hdr); in CIFSSMBEcho()
611 smb->Data[0] = 'a'; in CIFSSMBEcho()
612 inc_rfc1001_len(smb, 3); in CIFSSMBEcho()
615 iov[0].iov_base = smb; in CIFSSMBEcho()
616 iov[1].iov_len = get_rfc1002_length(smb); in CIFSSMBEcho()
617 iov[1].iov_base = (char *)smb + 4; in CIFSSMBEcho()
624 cifs_small_buf_release(smb); in CIFSSMBEcho()
674 since server closed smb session, no sense reporting in CIFSSMBLogoff()
724 * Note that SMB offsets are from the beginning of SMB which is 4 bytes in CIFSPOSIXDelFile()
934 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSPOSIXCreate()
966 rc = -EIO; /* bad smb */ in CIFSPOSIXCreate()
1328 cifs_dbg(VFS, "SMB signature verification returned error = %d\n", in cifs_readv_callback()
1379 READ_REQ *smb = NULL; in cifs_async_readv() local
1398 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **)&smb); in cifs_async_readv()
1402 smb->hdr.Pid = cpu_to_le16((__u16)rdata->req->pid); in cifs_async_readv()
1403 smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->req->pid >> 16)); in cifs_async_readv()
1405 smb->AndXCommand = 0xFF; /* none */ in cifs_async_readv()
1406 smb->Fid = rdata->req->cfile->fid.netfid; in cifs_async_readv()
1407 smb->OffsetLow = cpu_to_le32(rdata->subreq.start & 0xFFFFFFFF); in cifs_async_readv()
1409 smb->OffsetHigh = cpu_to_le32(rdata->subreq.start >> 32); in cifs_async_readv()
1410 smb->Remaining = 0; in cifs_async_readv()
1411 smb->MaxCount = cpu_to_le16(rdata->subreq.len & 0xFFFF); in cifs_async_readv()
1412 smb->MaxCountHigh = cpu_to_le32(rdata->subreq.len >> 16); in cifs_async_readv()
1414 smb->ByteCount = 0; in cifs_async_readv()
1418 (struct smb_com_readx_req *)smb; in cifs_async_readv()
1423 rdata->iov[0].iov_base = smb; in cifs_async_readv()
1425 rdata->iov[1].iov_base = (char *)smb + 4; in cifs_async_readv()
1426 rdata->iov[1].iov_len = get_rfc1002_length(smb); in cifs_async_readv()
1433 cifs_small_buf_release(smb); in cifs_async_readv()
1511 /*check that DataLength would not go beyond end of SMB */ in CIFSSMBRead()
1626 byte_count = bytes_sent + 5; /* bigger pad, smaller smb hdr */ in CIFSSMBWrite()
1678 WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf; in cifs_writev_callback() local
1694 written = le16_to_cpu(smb->CountHigh); in cifs_writev_callback()
1696 written += le16_to_cpu(smb->Count); in cifs_writev_callback()
1741 WRITE_REQ *smb = NULL; in cifs_async_writev() local
1758 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **)&smb); in cifs_async_writev()
1762 smb->hdr.Pid = cpu_to_le16((__u16)wdata->req->pid); in cifs_async_writev()
1763 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->req->pid >> 16)); in cifs_async_writev()
1765 smb->AndXCommand = 0xFF; /* none */ in cifs_async_writev()
1766 smb->Fid = wdata->req->cfile->fid.netfid; in cifs_async_writev()
1767 smb->OffsetLow = cpu_to_le32(wdata->subreq.start & 0xFFFFFFFF); in cifs_async_writev()
1769 smb->OffsetHigh = cpu_to_le32(wdata->subreq.start >> 32); in cifs_async_writev()
1770 smb->Reserved = 0xFFFFFFFF; in cifs_async_writev()
1771 smb->WriteMode = 0; in cifs_async_writev()
1772 smb->Remaining = 0; in cifs_async_writev()
1774 smb->DataOffset = in cifs_async_writev()
1779 iov[0].iov_base = smb; in cifs_async_writev()
1780 iov[1].iov_len = get_rfc1002_length(smb) + 1; in cifs_async_writev()
1781 iov[1].iov_base = (char *)smb + 4; in cifs_async_writev()
1790 smb->DataLengthLow = cpu_to_le16(wdata->subreq.len & 0xFFFF); in cifs_async_writev()
1791 smb->DataLengthHigh = cpu_to_le16(wdata->subreq.len >> 16); in cifs_async_writev()
1794 inc_rfc1001_len(&smb->hdr, wdata->subreq.len + 1); in cifs_async_writev()
1795 put_bcc(wdata->subreq.len + 1, &smb->hdr); in cifs_async_writev()
1799 (struct smb_com_writex_req *)smb; in cifs_async_writev()
1812 cifs_small_buf_release(smb); in cifs_async_writev()
1879 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */ in CIFSSMBWrite2()
1882 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ { in CIFSSMBWrite2()
2076 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBPosixLock()
2089 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBPosixLock()
2132 rc = -EIO; /* bad smb */ in CIFSSMBPosixLock()
2321 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBRenameOpenFile()
2325 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBRenameOpenFile()
2417 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateSymLink()
2502 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateHardLink()
2907 * @size_of_data_area: size of SMB we got
2931 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
2945 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
3039 /* BB add check to make sure ACL does not overflow SMB */ in posix_acl_to_cifs()
3115 rc = -EIO; /* bad smb */ in cifs_do_get_acl()
3165 /* BB find max SMB size from sess */ in cifs_do_set_acl()
3284 rc = -EIO; /* bad smb */ in CIFSGetExtAttr()
3311 * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that
3378 cifs_dbg(FYI, "parms start after end of smb\n"); in validate_ntransact()
3381 cifs_dbg(FYI, "parm end after end of smb\n"); in validate_ntransact()
3384 cifs_dbg(FYI, "data starts after end of smb\n"); in validate_ntransact()
3387 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n", in validate_ntransact()
3392 cifs_dbg(FYI, "parm count and data count larger than SMB\n"); in validate_ntransact()
3451 cifs_dbg(FYI, "smb %p parm %p data %p\n", in CIFSSMBGetCIFSACL()
3455 rc = -EIO; /* bad smb */ in CIFSSMBGetCIFSACL()
3673 rc = -EIO; /* bad smb */ in CIFSSMBQFileInfo()
3723 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQPathInfo()
3758 rc = -EIO; /* bad smb */ in CIFSSMBQPathInfo()
3839 rc = -EIO; /* bad smb */ in CIFSSMBUnixQFileInfo()
3890 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBUnixQPathInfo()
3921 rc = -EIO; /* bad smb */ in CIFSSMBUnixQPathInfo()
4309 rc = -EIO; /* bad smb */ in CIFSGetSrvInodeNumber()
4395 /* BB find exact max SMB PDU from sess structure BB */ in CIFSGetDFSRefer()
4424 rc = -EIO; /* bad smb */ in CIFSGetDFSRefer()
4498 rc = -EIO; /* bad smb */ in SMBOldQFSInfo()
4585 rc = -EIO; /* bad smb */ in CIFSSMBQFSInfo()
4643 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSAttributeInfo()
4673 rc = -EIO; /* bad smb */ in CIFSSMBQFSAttributeInfo()
4713 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSDeviceInfo()
4744 rc = -EIO; /* bad smb */ in CIFSSMBQFSDeviceInfo()
4786 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSUnixInfo()
4813 rc = -EIO; /* bad smb */ in CIFSSMBQFSUnixInfo()
4862 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFSUnixInfo()
4895 rc = -EIO; /* bad smb */ in CIFSSMBSetFSUnixInfo()
4931 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSPosixInfo()
4958 rc = -EIO; /* bad smb */ in CIFSSMBQFSPosixInfo()
5126 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFileSize()
5137 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileSize()
5269 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileInfo()
5329 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileDisposition()
5334 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileDisposition()
5428 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBSetPathInfo()
5556 /* BB find max SMB PDU from sess */ in CIFSSMBUnixSetFileInfo()
5622 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBUnixSetPathInfo()
5632 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBUnixSetPathInfo()
5714 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQAllEAs()
5750 rc = -EIO; /* bad smb */ in CIFSSMBQAllEAs()
5760 /* BB check if start of smb + data_offset > &bcc+ bcc */ in CIFSSMBQAllEAs()
5776 /* make sure list_len doesn't go past end of SMB */ in CIFSSMBQAllEAs()
5779 cifs_dbg(FYI, "EA list appears to go beyond SMB\n"); in CIFSSMBQAllEAs()
5903 /* BB find max SMB PDU from sess */ in CIFSSMBSetEA()
5932 we need to ensure that it fits within the smb */ in CIFSSMBSetEA()
5935 negotiated SMB buffer size BB */ in CIFSSMBSetEA()