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 */
80 * tcp and smb session status done differently for those three - in the in cifs_reconnect_tcon()
138 * reconnect the same SMB session in cifs_reconnect_tcon()
208 /* Allocate and return pointer to an SMB request buffer, and set basic
209 SMB information in the SMB header. If the return code is zero, this
273 /* potential retries of smb operations it turns out we can determine */ in __smb_init()
325 /* check for parm and data offset going beyond end of smb */ in validate_t2()
335 * less than negotiated smb buffer in validate_t2()
344 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB, in validate_t2()
574 ECHO_REQ *smb; in CIFSSMBEcho() local
582 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); in CIFSSMBEcho()
587 smb->hdr.Flags2 |= SMBFLG2_UNICODE; in CIFSSMBEcho()
590 smb->hdr.Tid = 0xffff; in CIFSSMBEcho()
591 smb->hdr.WordCount = 1; in CIFSSMBEcho()
592 put_unaligned_le16(1, &smb->EchoCount); in CIFSSMBEcho()
593 put_bcc(1, &smb->hdr); in CIFSSMBEcho()
594 smb->Data[0] = 'a'; in CIFSSMBEcho()
595 inc_rfc1001_len(smb, 3); in CIFSSMBEcho()
598 iov[0].iov_base = smb; in CIFSSMBEcho()
599 iov[1].iov_len = get_rfc1002_length(smb); in CIFSSMBEcho()
600 iov[1].iov_base = (char *)smb + 4; in CIFSSMBEcho()
607 cifs_small_buf_release(smb); in CIFSSMBEcho()
657 since server closed smb session, no sense reporting in CIFSSMBLogoff()
707 * Note that SMB offsets are from the beginning of SMB which is 4 bytes in CIFSPOSIXDelFile()
917 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSPOSIXCreate()
949 rc = -EIO; /* bad smb */ in CIFSPOSIXCreate()
1303 cifs_dbg(VFS, "SMB signature verification returned error = %d\n", in cifs_readv_callback()
1349 READ_REQ *smb = NULL; in cifs_async_readv() local
1368 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **)&smb); in cifs_async_readv()
1372 smb->hdr.Pid = cpu_to_le16((__u16)rdata->req->pid); in cifs_async_readv()
1373 smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->req->pid >> 16)); in cifs_async_readv()
1375 smb->AndXCommand = 0xFF; /* none */ in cifs_async_readv()
1376 smb->Fid = rdata->req->cfile->fid.netfid; in cifs_async_readv()
1377 smb->OffsetLow = cpu_to_le32(rdata->subreq.start & 0xFFFFFFFF); in cifs_async_readv()
1379 smb->OffsetHigh = cpu_to_le32(rdata->subreq.start >> 32); in cifs_async_readv()
1380 smb->Remaining = 0; in cifs_async_readv()
1381 smb->MaxCount = cpu_to_le16(rdata->subreq.len & 0xFFFF); in cifs_async_readv()
1382 smb->MaxCountHigh = cpu_to_le32(rdata->subreq.len >> 16); in cifs_async_readv()
1384 smb->ByteCount = 0; in cifs_async_readv()
1388 (struct smb_com_readx_req *)smb; in cifs_async_readv()
1393 rdata->iov[0].iov_base = smb; in cifs_async_readv()
1395 rdata->iov[1].iov_base = (char *)smb + 4; in cifs_async_readv()
1396 rdata->iov[1].iov_len = get_rfc1002_length(smb); in cifs_async_readv()
1403 cifs_small_buf_release(smb); in cifs_async_readv()
1481 /*check that DataLength would not go beyond end of SMB */ in CIFSSMBRead()
1596 byte_count = bytes_sent + 5; /* bigger pad, smaller smb hdr */ in CIFSSMBWrite()
1648 WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf; in cifs_writev_callback() local
1664 written = le16_to_cpu(smb->CountHigh); in cifs_writev_callback()
1666 written += le16_to_cpu(smb->Count); in cifs_writev_callback()
1708 WRITE_REQ *smb = NULL; in cifs_async_writev() local
1725 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **)&smb); in cifs_async_writev()
1729 smb->hdr.Pid = cpu_to_le16((__u16)wdata->req->pid); in cifs_async_writev()
1730 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->req->pid >> 16)); in cifs_async_writev()
1732 smb->AndXCommand = 0xFF; /* none */ in cifs_async_writev()
1733 smb->Fid = wdata->req->cfile->fid.netfid; in cifs_async_writev()
1734 smb->OffsetLow = cpu_to_le32(wdata->subreq.start & 0xFFFFFFFF); in cifs_async_writev()
1736 smb->OffsetHigh = cpu_to_le32(wdata->subreq.start >> 32); in cifs_async_writev()
1737 smb->Reserved = 0xFFFFFFFF; in cifs_async_writev()
1738 smb->WriteMode = 0; in cifs_async_writev()
1739 smb->Remaining = 0; in cifs_async_writev()
1741 smb->DataOffset = in cifs_async_writev()
1746 iov[0].iov_base = smb; in cifs_async_writev()
1747 iov[1].iov_len = get_rfc1002_length(smb) + 1; in cifs_async_writev()
1748 iov[1].iov_base = (char *)smb + 4; in cifs_async_writev()
1757 smb->DataLengthLow = cpu_to_le16(wdata->subreq.len & 0xFFFF); in cifs_async_writev()
1758 smb->DataLengthHigh = cpu_to_le16(wdata->subreq.len >> 16); in cifs_async_writev()
1761 inc_rfc1001_len(&smb->hdr, wdata->subreq.len + 1); in cifs_async_writev()
1762 put_bcc(wdata->subreq.len + 1, &smb->hdr); in cifs_async_writev()
1766 (struct smb_com_writex_req *)smb; in cifs_async_writev()
1779 cifs_small_buf_release(smb); in cifs_async_writev()
1846 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */ in CIFSSMBWrite2()
1849 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ { in CIFSSMBWrite2()
2043 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBPosixLock()
2056 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBPosixLock()
2099 rc = -EIO; /* bad smb */ in CIFSSMBPosixLock()
2288 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBRenameOpenFile()
2292 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBRenameOpenFile()
2447 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateSymLink()
2532 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateHardLink()
2934 * @size_of_data_area: size of SMB we got
2958 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
2972 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
3066 /* BB add check to make sure ACL does not overflow SMB */ in posix_acl_to_cifs()
3142 rc = -EIO; /* bad smb */ in cifs_do_get_acl()
3192 /* BB find max SMB size from sess */ in cifs_do_set_acl()
3311 rc = -EIO; /* bad smb */ in CIFSGetExtAttr()
3338 * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that
3405 cifs_dbg(FYI, "parms start after end of smb\n"); in validate_ntransact()
3408 cifs_dbg(FYI, "parm end after end of smb\n"); in validate_ntransact()
3411 cifs_dbg(FYI, "data starts after end of smb\n"); in validate_ntransact()
3414 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n", in validate_ntransact()
3419 cifs_dbg(FYI, "parm count and data count larger than SMB\n"); in validate_ntransact()
3479 cifs_dbg(FYI, "smb %p parm %p data %p\n", in CIFSSMBGetCIFSACL()
3483 rc = -EIO; /* bad smb */ in CIFSSMBGetCIFSACL()
3701 rc = -EIO; /* bad smb */ in CIFSSMBQFileInfo()
3751 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQPathInfo()
3786 rc = -EIO; /* bad smb */ in CIFSSMBQPathInfo()
3867 rc = -EIO; /* bad smb */ in CIFSSMBUnixQFileInfo()
3918 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBUnixQPathInfo()
3949 rc = -EIO; /* bad smb */ in CIFSSMBUnixQPathInfo()
4337 rc = -EIO; /* bad smb */ in CIFSGetSrvInodeNumber()
4423 /* BB find exact max SMB PDU from sess structure BB */ in CIFSGetDFSRefer()
4452 rc = -EIO; /* bad smb */ in CIFSGetDFSRefer()
4526 rc = -EIO; /* bad smb */ in SMBOldQFSInfo()
4613 rc = -EIO; /* bad smb */ in CIFSSMBQFSInfo()
4671 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSAttributeInfo()
4701 rc = -EIO; /* bad smb */ in CIFSSMBQFSAttributeInfo()
4741 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSDeviceInfo()
4772 rc = -EIO; /* bad smb */ in CIFSSMBQFSDeviceInfo()
4814 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSUnixInfo()
4841 rc = -EIO; /* bad smb */ in CIFSSMBQFSUnixInfo()
4890 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFSUnixInfo()
4923 rc = -EIO; /* bad smb */ in CIFSSMBSetFSUnixInfo()
4959 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSPosixInfo()
4986 rc = -EIO; /* bad smb */ in CIFSSMBQFSPosixInfo()
5154 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFileSize()
5165 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileSize()
5240 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileInfo()
5300 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileDisposition()
5305 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileDisposition()
5399 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBSetPathInfo()
5527 /* BB find max SMB PDU from sess */ in CIFSSMBUnixSetFileInfo()
5593 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBUnixSetPathInfo()
5603 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBUnixSetPathInfo()
5685 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQAllEAs()
5721 rc = -EIO; /* bad smb */ in CIFSSMBQAllEAs()
5731 /* BB check if start of smb + data_offset > &bcc+ bcc */ in CIFSSMBQAllEAs()
5747 /* make sure list_len doesn't go past end of SMB */ in CIFSSMBQAllEAs()
5750 cifs_dbg(FYI, "EA list appears to go beyond SMB\n"); in CIFSSMBQAllEAs()
5874 /* BB find max SMB PDU from sess */ in CIFSSMBSetEA()
5903 we need to ensure that it fits within the smb */ in CIFSSMBSetEA()
5906 negotiated SMB buffer size BB */ in CIFSSMBSetEA()