Lines Matching refs:ses
74 if (!tcon || !tcon->ses) in smb3_encryption_required()
76 if ((tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || in smb3_encryption_required()
80 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION)) in smb3_encryption_required()
119 if (tcon->ses) in smb2_hdr_assemble()
120 shdr->SessionId = cpu_to_le64(tcon->ses->Suid); in smb2_hdr_assemble()
147 struct cifs_ses *ses; in smb2_reconnect() local
179 if ((!tcon->ses) || (tcon->ses->status == CifsExiting) || in smb2_reconnect()
180 (!tcon->ses->server) || !server) in smb2_reconnect()
183 ses = tcon->ses; in smb2_reconnect()
235 if (!tcon->ses->need_reconnect && !tcon->need_reconnect) in smb2_reconnect()
244 mutex_lock(&tcon->ses->session_mutex); in smb2_reconnect()
253 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
261 ses->binding = true; in smb2_reconnect()
262 ses->binding_chan = cifs_ses_find_chan(ses, server); in smb2_reconnect()
265 rc = cifs_negotiate_protocol(0, tcon->ses); in smb2_reconnect()
266 if (!rc && tcon->ses->need_reconnect) { in smb2_reconnect()
267 rc = cifs_setup_session(0, tcon->ses, nls_codepage); in smb2_reconnect()
270 ses->binding = false; in smb2_reconnect()
271 ses->binding_chan = NULL; in smb2_reconnect()
272 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
279 ses->binding = false; in smb2_reconnect()
280 ses->binding_chan = NULL; in smb2_reconnect()
283 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
292 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
836 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) in SMB2_negotiate() argument
845 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_negotiate()
866 memset(ses->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE); in SMB2_negotiate()
891 if (ses->sign) in SMB2_negotiate()
899 if (ses->chan_max > 1) in SMB2_negotiate()
922 rc = cifs_send_recv(xid, ses, server, in SMB2_negotiate()
998 memcpy(server->preauth_sha_hash, ses->preauth_sha_hash, in SMB2_negotiate()
1037 rc = cifs_enable_signing(server, ses->sign); in SMB2_negotiate()
1067 struct TCP_Server_Info *server = tcon->ses->server; in smb3_validate_negotiate()
1082 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) in smb3_validate_negotiate()
1085 if (tcon->ses->user_name == NULL) { in smb3_validate_negotiate()
1090 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) in smb3_validate_negotiate()
1099 if (tcon->ses->chan_max > 1) in smb3_validate_negotiate()
1105 if (tcon->ses->sign) in smb3_validate_negotiate()
1223 struct cifs_ses *ses; member
1244 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_alloc_buffer() local
1246 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_alloc_buffer()
1255 if (sess_data->ses->binding) { in SMB2_sess_alloc_buffer()
1256 req->hdr.SessionId = cpu_to_le64(sess_data->ses->Suid); in SMB2_sess_alloc_buffer()
1327 rc = cifs_send_recv(sess_data->xid, sess_data->ses, in SMB2_sess_sendreceive()
1328 cifs_ses_server(sess_data->ses), in SMB2_sess_sendreceive()
1342 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_establish_session() local
1343 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_establish_session()
1347 rc = server->ops->generate_signingkey(ses); in SMB2_sess_establish_session()
1363 if (!ses->binding) { in SMB2_sess_establish_session()
1365 ses->status = CifsGood; in SMB2_sess_establish_session()
1366 ses->need_reconnect = false; in SMB2_sess_establish_session()
1378 struct cifs_ses *ses = sess_data->ses; in SMB2_auth_kerberos() local
1387 spnego_key = cifs_get_spnego_key(ses); in SMB2_auth_kerberos()
1409 if (!ses->binding) { in SMB2_auth_kerberos()
1410 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, in SMB2_auth_kerberos()
1412 if (!ses->auth_key.response) { in SMB2_auth_kerberos()
1418 ses->auth_key.len = msg->sesskey_len; in SMB2_auth_kerberos()
1430 if (!ses->binding) { in SMB2_auth_kerberos()
1431 ses->Suid = le64_to_cpu(rsp->hdr.SessionId); in SMB2_auth_kerberos()
1432 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_auth_kerberos()
1461 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_negotiate() local
1471 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); in SMB2_sess_auth_rawntlmssp_negotiate()
1472 if (!ses->ntlmssp) { in SMB2_sess_auth_rawntlmssp_negotiate()
1476 ses->ntlmssp->sesskey_per_smbsess = true; in SMB2_sess_auth_rawntlmssp_negotiate()
1483 &blob_length, ses, in SMB2_sess_auth_rawntlmssp_negotiate()
1516 le16_to_cpu(rsp->SecurityBufferLength), ses); in SMB2_sess_auth_rawntlmssp_negotiate()
1523 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_negotiate()
1524 ses->Suid = le64_to_cpu(rsp->hdr.SessionId); in SMB2_sess_auth_rawntlmssp_negotiate()
1525 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_negotiate()
1537 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_negotiate()
1538 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_negotiate()
1547 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_authenticate() local
1559 req->hdr.SessionId = cpu_to_le64(ses->Suid); in SMB2_sess_auth_rawntlmssp_authenticate()
1561 rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length, ses, in SMB2_sess_auth_rawntlmssp_authenticate()
1584 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_authenticate()
1585 ses->Suid = le64_to_cpu(rsp->hdr.SessionId); in SMB2_sess_auth_rawntlmssp_authenticate()
1586 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_authenticate()
1591 if (ses->server->dialect < SMB30_PROT_ID) { in SMB2_sess_auth_rawntlmssp_authenticate()
1597 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid), in SMB2_sess_auth_rawntlmssp_authenticate()
1598 &ses->Suid); in SMB2_sess_auth_rawntlmssp_authenticate()
1600 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1602 SMB3_SIGN_KEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1608 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_authenticate()
1609 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_authenticate()
1615 SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data) in SMB2_select_sec() argument
1619 type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype); in SMB2_select_sec()
1642 SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, in SMB2_sess_setup() argument
1646 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_setup()
1660 rc = SMB2_select_sec(ses, sess_data); in SMB2_sess_setup()
1664 sess_data->ses = ses; in SMB2_sess_setup()
1667 sess_data->previous_session = ses->Suid; in SMB2_sess_setup()
1672 memcpy(ses->preauth_sha_hash, server->preauth_sha_hash, in SMB2_sess_setup()
1678 if ((ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) && (ses->sign)) in SMB2_sess_setup()
1687 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) in SMB2_logoff() argument
1699 cifs_dbg(FYI, "disconnect session %p\n", ses); in SMB2_logoff()
1701 if (ses && (ses->server)) in SMB2_logoff()
1702 server = ses->server; in SMB2_logoff()
1707 if (ses->need_reconnect) in SMB2_logoff()
1710 rc = smb2_plain_req_init(SMB2_LOGOFF, NULL, ses->server, in SMB2_logoff()
1716 req->hdr.SessionId = cpu_to_le64(ses->Suid); in SMB2_logoff()
1718 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) in SMB2_logoff()
1732 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_logoff()
1760 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, in SMB2_tcon() argument
1777 server = ses->server; in SMB2_tcon()
1826 !(ses->session_flags & in SMB2_tcon()
1828 ((ses->user_name != NULL) || (ses->sectype == Kerberos))) in SMB2_tcon()
1838 rc = cifs_send_recv(xid, ses, server, in SMB2_tcon()
1842 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc); in SMB2_tcon()
1904 struct cifs_ses *ses = tcon->ses; in SMB2_tdis() local
1913 if (!ses || !(ses->server)) in SMB2_tdis()
1916 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) in SMB2_tdis()
1921 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, ses->server, in SMB2_tdis()
1939 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_tdis()
2545 struct cifs_ses *ses = tcon->ses; in smb311_posix_mkdir() local
2559 struct TCP_Server_Info *server = cifs_pick_channel(ses); in smb311_posix_mkdir()
2568 if (!ses || !server) { in smb311_posix_mkdir()
2658 trace_smb3_posix_mkdir_enter(xid, tcon->tid, ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2661 rc = cifs_send_recv(xid, ses, server, in smb311_posix_mkdir()
2665 trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid, in smb311_posix_mkdir()
2685 ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2906 struct cifs_ses *ses = tcon->ses; in SMB2_open() local
2907 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_open()
2915 if (!ses || !server) in SMB2_open()
2931 trace_smb3_open_enter(xid, tcon->tid, tcon->ses->Suid, in SMB2_open()
2934 rc = cifs_send_recv(xid, ses, server, in SMB2_open()
2947 trace_smb3_open_err(xid, tcon->tid, ses->Suid, in SMB2_open()
2960 ses->Suid, oparms->create_options, in SMB2_open()
3107 struct cifs_ses *ses; in SMB2_ioctl() local
3127 ses = tcon->ses; in SMB2_ioctl()
3128 if (!ses) in SMB2_ioctl()
3131 server = cifs_pick_channel(ses); in SMB2_ioctl()
3149 rc = cifs_send_recv(xid, ses, server, in SMB2_ioctl()
3156 ses->Suid, 0, opcode, rc); in SMB2_ioctl()
3288 struct cifs_ses *ses = tcon->ses; in __SMB2_close() local
3289 struct TCP_Server_Info *server = cifs_pick_channel(ses); in __SMB2_close()
3299 if (!ses || !server) in __SMB2_close()
3314 trace_smb3_close_enter(xid, persistent_fid, tcon->tid, ses->Suid); in __SMB2_close()
3321 rc = cifs_send_recv(xid, ses, server, in __SMB2_close()
3327 trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid, in __SMB2_close()
3332 ses->Suid); in __SMB2_close()
3477 struct cifs_ses *ses = tcon->ses; in query_info() local
3484 if (!ses) in query_info()
3486 server = cifs_pick_channel(ses); in query_info()
3506 ses->Suid, info_class, (__u32)info_type); in query_info()
3508 rc = cifs_send_recv(xid, ses, server, in query_info()
3515 ses->Suid, info_class, (__u32)info_type, rc); in query_info()
3520 ses->Suid, info_class, (__u32)info_type); in query_info()
3648 struct cifs_ses *ses = tcon->ses; in SMB2_change_notify() local
3649 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_change_notify()
3658 if (!ses || !server) in SMB2_change_notify()
3675 trace_smb3_notify_enter(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3677 rc = cifs_send_recv(xid, ses, server, in SMB2_change_notify()
3682 trace_smb3_notify_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3686 ses->Suid, (u8)watch_tree, completion_filter); in SMB2_change_notify()
3725 struct cifs_ses *ses; in smb2_reconnect_server() local
3740 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in smb2_reconnect_server()
3741 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in smb2_reconnect_server()
3752 if (ses->tcon_ipc && ses->tcon_ipc->need_reconnect) { in smb2_reconnect_server()
3753 list_add_tail(&ses->tcon_ipc->rlist, &tmp_list); in smb2_reconnect_server()
3755 ses->ses_count++; in smb2_reconnect_server()
3775 cifs_put_smb_ses(tcon->ses); in smb2_reconnect_server()
3862 struct cifs_ses *ses = tcon->ses; in SMB2_flush() local
3866 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_flush()
3872 if (!ses || !(ses->server)) in SMB2_flush()
3888 trace_smb3_flush_enter(xid, persistent_fid, tcon->tid, ses->Suid); in SMB2_flush()
3889 rc = cifs_send_recv(xid, ses, server, in SMB2_flush()
3894 trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_flush()
3898 ses->Suid); in SMB2_flush()
3942 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in smb2_new_read_req()
4079 tcon->tid, tcon->ses->Suid, rdata->offset, in smb2_readv_callback()
4084 tcon->tid, tcon->ses->Suid, in smb2_readv_callback()
4110 rdata->server = cifs_pick_channel(tcon->ses); in smb2_async_readv()
4155 io_parms.tcon->ses->Suid, in smb2_async_readv()
4176 struct cifs_ses *ses = io_parms->tcon->ses; in SMB2_read() local
4179 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_read()
4196 rc = cifs_send_recv(xid, ses, io_parms->server, in SMB2_read()
4206 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4212 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4220 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4317 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_writev_callback()
4325 tcon->tid, tcon->ses->Suid, in smb2_writev_callback()
4348 server = wdata->server = cifs_pick_channel(tcon->ses); in smb2_async_writev()
4372 tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes); in smb2_async_writev()
4461 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_async_writev()
4498 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_write()
4525 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in SMB2_write()
4536 rc = cifs_send_recv(xid, io_parms->tcon->ses, server, in SMB2_write()
4545 io_parms->tcon->ses->Suid, in SMB2_write()
4554 io_parms->tcon->ses->Suid, in SMB2_write()
4775 tcon->ses->Suid, index, output_size); in SMB2_query_directory_init()
4870 struct cifs_ses *ses = tcon->ses; in SMB2_query_directory() local
4871 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_query_directory()
4874 if (!ses || !(ses->server)) in SMB2_query_directory()
4892 rc = cifs_send_recv(xid, ses, server, in SMB2_query_directory()
4900 tcon->tid, tcon->ses->Suid, index, 0); in SMB2_query_directory()
4905 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4915 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4921 tcon->ses->Suid, index, srch_inf->entries_in_buffer); in SMB2_query_directory()
4992 struct cifs_ses *ses = tcon->ses; in send_set_info() local
4993 struct TCP_Server_Info *server = cifs_pick_channel(ses); in send_set_info()
4996 if (!ses || !server) in send_set_info()
5023 rc = cifs_send_recv(xid, ses, server, in send_set_info()
5032 ses->Suid, info_class, (__u32)info_type, rc); in send_set_info()
5086 struct cifs_ses *ses = tcon->ses; in SMB2_oplock_break() local
5087 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_oplock_break()
5117 rc = cifs_send_recv(xid, ses, server, in SMB2_oplock_break()
5172 if ((tcon->ses == NULL) || server == NULL) in build_qfs_info_req()
5205 struct cifs_ses *ses = tcon->ses; in SMB311_posix_qfs_info() local
5206 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB311_posix_qfs_info()
5224 rc = cifs_send_recv(xid, ses, server, in SMB311_posix_qfs_info()
5256 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_info() local
5257 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_info()
5275 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_info()
5307 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_attr() local
5308 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_attr()
5342 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_attr()
5396 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in smb2_lockv()
5427 rc = cifs_send_recv(xid, tcon->ses, server, in smb2_lockv()
5435 tcon->ses->Suid, rc); in smb2_lockv()
5465 struct cifs_ses *ses = tcon->ses; in SMB2_lease_break() local
5473 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in SMB2_lease_break()
5500 rc = cifs_send_recv(xid, ses, server, in SMB2_lease_break()
5509 ses->Suid, *please_key_low, *please_key_high, rc); in SMB2_lease_break()
5513 ses->Suid, *please_key_low, *please_key_high); in SMB2_lease_break()