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 */
67 /* reconnect the socket, tcon, and smb session if needed */
78 * tcp and smb session status done differently for those three - in the in cifs_reconnect_tcon()
136 * reconnect the same SMB session in cifs_reconnect_tcon()
206 /* Allocate and return pointer to an SMB request buffer, and set basic
207 SMB information in the SMB header. If the return code is zero, this
271 /* potential retries of smb operations it turns out we can determine */ in __smb_init()
323 /* check for parm and data offset going beyond end of smb */ in validate_t2()
333 * less than negotiated smb buffer in validate_t2()
342 cifs_dump_mem("Invalid transact2 SMB: ", (char *)pSMB, in validate_t2()
572 ECHO_REQ *smb; in CIFSSMBEcho() local
580 rc = small_smb_init(SMB_COM_ECHO, 0, NULL, (void **)&smb); in CIFSSMBEcho()
585 smb->hdr.Flags2 |= SMBFLG2_UNICODE; in CIFSSMBEcho()
588 smb->hdr.Tid = 0xffff; in CIFSSMBEcho()
589 smb->hdr.WordCount = 1; in CIFSSMBEcho()
590 put_unaligned_le16(1, &smb->EchoCount); in CIFSSMBEcho()
591 put_bcc(1, &smb->hdr); in CIFSSMBEcho()
592 smb->Data[0] = 'a'; in CIFSSMBEcho()
593 inc_rfc1001_len(smb, 3); in CIFSSMBEcho()
596 iov[0].iov_base = smb; in CIFSSMBEcho()
597 iov[1].iov_len = get_rfc1002_length(smb); in CIFSSMBEcho()
598 iov[1].iov_base = (char *)smb + 4; in CIFSSMBEcho()
605 cifs_small_buf_release(smb); in CIFSSMBEcho()
655 since server closed smb session, no sense reporting in CIFSSMBLogoff()
705 * Note that SMB offsets are from the beginning of SMB which is 4 bytes in CIFSPOSIXDelFile()
915 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSPOSIXCreate()
947 rc = -EIO; /* bad smb */ in CIFSPOSIXCreate()
1287 cifs_dbg(VFS, "SMB signature verification returned error = %d\n", in cifs_readv_callback()
1318 READ_REQ *smb = NULL; in cifs_async_readv() local
1337 rc = small_smb_init(SMB_COM_READ_ANDX, wct, tcon, (void **)&smb); in cifs_async_readv()
1341 smb->hdr.Pid = cpu_to_le16((__u16)rdata->pid); in cifs_async_readv()
1342 smb->hdr.PidHigh = cpu_to_le16((__u16)(rdata->pid >> 16)); in cifs_async_readv()
1344 smb->AndXCommand = 0xFF; /* none */ in cifs_async_readv()
1345 smb->Fid = rdata->cfile->fid.netfid; in cifs_async_readv()
1346 smb->OffsetLow = cpu_to_le32(rdata->offset & 0xFFFFFFFF); in cifs_async_readv()
1348 smb->OffsetHigh = cpu_to_le32(rdata->offset >> 32); in cifs_async_readv()
1349 smb->Remaining = 0; in cifs_async_readv()
1350 smb->MaxCount = cpu_to_le16(rdata->bytes & 0xFFFF); in cifs_async_readv()
1351 smb->MaxCountHigh = cpu_to_le32(rdata->bytes >> 16); in cifs_async_readv()
1353 smb->ByteCount = 0; in cifs_async_readv()
1357 (struct smb_com_readx_req *)smb; in cifs_async_readv()
1362 rdata->iov[0].iov_base = smb; in cifs_async_readv()
1364 rdata->iov[1].iov_base = (char *)smb + 4; in cifs_async_readv()
1365 rdata->iov[1].iov_len = get_rfc1002_length(smb); in cifs_async_readv()
1376 cifs_small_buf_release(smb); in cifs_async_readv()
1454 /*check that DataLength would not go beyond end of SMB */ in CIFSSMBRead()
1569 byte_count = bytes_sent + 5; /* bigger pad, smaller smb hdr */ in CIFSSMBWrite()
1621 WRITE_RSP *smb = (WRITE_RSP *)mid->resp_buf; in cifs_writev_callback() local
1630 written = le16_to_cpu(smb->CountHigh); in cifs_writev_callback()
1632 written += le16_to_cpu(smb->Count); in cifs_writev_callback()
1667 WRITE_REQ *smb = NULL; in cifs_async_writev() local
1683 rc = small_smb_init(SMB_COM_WRITE_ANDX, wct, tcon, (void **)&smb); in cifs_async_writev()
1687 smb->hdr.Pid = cpu_to_le16((__u16)wdata->pid); in cifs_async_writev()
1688 smb->hdr.PidHigh = cpu_to_le16((__u16)(wdata->pid >> 16)); in cifs_async_writev()
1690 smb->AndXCommand = 0xFF; /* none */ in cifs_async_writev()
1691 smb->Fid = wdata->cfile->fid.netfid; in cifs_async_writev()
1692 smb->OffsetLow = cpu_to_le32(wdata->offset & 0xFFFFFFFF); in cifs_async_writev()
1694 smb->OffsetHigh = cpu_to_le32(wdata->offset >> 32); in cifs_async_writev()
1695 smb->Reserved = 0xFFFFFFFF; in cifs_async_writev()
1696 smb->WriteMode = 0; in cifs_async_writev()
1697 smb->Remaining = 0; in cifs_async_writev()
1699 smb->DataOffset = in cifs_async_writev()
1704 iov[0].iov_base = smb; in cifs_async_writev()
1705 iov[1].iov_len = get_rfc1002_length(smb) + 1; in cifs_async_writev()
1706 iov[1].iov_base = (char *)smb + 4; in cifs_async_writev()
1716 smb->DataLengthLow = cpu_to_le16(wdata->bytes & 0xFFFF); in cifs_async_writev()
1717 smb->DataLengthHigh = cpu_to_le16(wdata->bytes >> 16); in cifs_async_writev()
1720 inc_rfc1001_len(&smb->hdr, wdata->bytes + 1); in cifs_async_writev()
1721 put_bcc(wdata->bytes + 1, &smb->hdr); in cifs_async_writev()
1725 (struct smb_com_writex_req *)smb; in cifs_async_writev()
1741 cifs_small_buf_release(smb); in cifs_async_writev()
1804 inc_rfc1001_len(pSMB, count + 5); /* smb data starts later */ in CIFSSMBWrite2()
1807 else /* wct == 12 */ /* bigger pad, smaller smb hdr, keep offset ok */ { in CIFSSMBWrite2()
2001 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBPosixLock()
2014 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBPosixLock()
2057 rc = -EIO; /* bad smb */ in CIFSSMBPosixLock()
2246 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBRenameOpenFile()
2250 pSMB->MaxDataCount = cpu_to_le16(1000); /* BB find max SMB from sess */ in CIFSSMBRenameOpenFile()
2405 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateSymLink()
2490 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSUnixCreateHardLink()
2892 * @size_of_data_area: size of SMB we got
2916 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
2930 /* check if we would go beyond end of SMB */ in cifs_to_posix_acl()
3024 /* BB add check to make sure ACL does not overflow SMB */ in posix_acl_to_cifs()
3100 rc = -EIO; /* bad smb */ in cifs_do_get_acl()
3150 /* BB find max SMB size from sess */ in cifs_do_set_acl()
3269 rc = -EIO; /* bad smb */ in CIFSGetExtAttr()
3296 * Initialize NT TRANSACT SMB into small smb request buffer. This assumes that
3363 cifs_dbg(FYI, "parms start after end of smb\n"); in validate_ntransact()
3366 cifs_dbg(FYI, "parm end after end of smb\n"); in validate_ntransact()
3369 cifs_dbg(FYI, "data starts after end of smb\n"); in validate_ntransact()
3372 cifs_dbg(FYI, "data %p + count %d (%p) past smb end %p start %p\n", in validate_ntransact()
3377 cifs_dbg(FYI, "parm count and data count larger than SMB\n"); in validate_ntransact()
3437 cifs_dbg(FYI, "smb %p parm %p data %p\n", in CIFSSMBGetCIFSACL()
3441 rc = -EIO; /* bad smb */ in CIFSSMBGetCIFSACL()
3659 rc = -EIO; /* bad smb */ in CIFSSMBQFileInfo()
3709 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQPathInfo()
3744 rc = -EIO; /* bad smb */ in CIFSSMBQPathInfo()
3825 rc = -EIO; /* bad smb */ in CIFSSMBUnixQFileInfo()
3876 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBUnixQPathInfo()
3907 rc = -EIO; /* bad smb */ in CIFSSMBUnixQPathInfo()
4295 rc = -EIO; /* bad smb */ in CIFSGetSrvInodeNumber()
4381 /* BB find exact max SMB PDU from sess structure BB */ in CIFSGetDFSRefer()
4410 rc = -EIO; /* bad smb */ in CIFSGetDFSRefer()
4484 rc = -EIO; /* bad smb */ in SMBOldQFSInfo()
4571 rc = -EIO; /* bad smb */ in CIFSSMBQFSInfo()
4629 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSAttributeInfo()
4659 rc = -EIO; /* bad smb */ in CIFSSMBQFSAttributeInfo()
4699 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSDeviceInfo()
4730 rc = -EIO; /* bad smb */ in CIFSSMBQFSDeviceInfo()
4772 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSUnixInfo()
4799 rc = -EIO; /* bad smb */ in CIFSSMBQFSUnixInfo()
4848 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFSUnixInfo()
4881 rc = -EIO; /* bad smb */ in CIFSSMBSetFSUnixInfo()
4917 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQFSPosixInfo()
4944 rc = -EIO; /* bad smb */ in CIFSSMBQFSPosixInfo()
5112 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBSetFileSize()
5123 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileSize()
5198 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileInfo()
5258 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBSetFileDisposition()
5263 /* BB find max SMB PDU from sess */ in CIFSSMBSetFileDisposition()
5357 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBSetPathInfo()
5485 /* BB find max SMB PDU from sess */ in CIFSSMBUnixSetFileInfo()
5551 /* BB find max SMB PDU from sess structure BB */ in CIFSSMBUnixSetPathInfo()
5561 /* SMB offsets are from the beginning of SMB which is 4 bytes in, after RFC1001 field */ in CIFSSMBUnixSetPathInfo()
5643 /* BB find exact max SMB PDU from sess structure BB */ in CIFSSMBQAllEAs()
5679 rc = -EIO; /* bad smb */ in CIFSSMBQAllEAs()
5689 /* BB check if start of smb + data_offset > &bcc+ bcc */ in CIFSSMBQAllEAs()
5705 /* make sure list_len doesn't go past end of SMB */ in CIFSSMBQAllEAs()
5708 cifs_dbg(FYI, "EA list appears to go beyond SMB\n"); in CIFSSMBQAllEAs()
5832 /* BB find max SMB PDU from sess */ in CIFSSMBSetEA()
5863 we need to ensure that it fits within the smb */ in CIFSSMBSetEA()
5866 negotiated SMB buffer size BB */ in CIFSSMBSetEA()