Lines Matching refs:ses
88 if (!tcon || !tcon->ses) in smb3_encryption_required()
90 if ((tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) || in smb3_encryption_required()
94 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION)) in smb3_encryption_required()
133 if (tcon->ses) in smb2_hdr_assemble()
134 shdr->SessionId = tcon->ses->Suid; in smb2_hdr_assemble()
161 struct cifs_ses *ses; in smb2_reconnect() local
189 if ((!tcon->ses) || (tcon->ses->status == CifsExiting) || in smb2_reconnect()
190 (!tcon->ses->server) || !server) in smb2_reconnect()
193 ses = tcon->ses; in smb2_reconnect()
245 if (!tcon->ses->need_reconnect && !tcon->need_reconnect) in smb2_reconnect()
254 mutex_lock(&tcon->ses->session_mutex); in smb2_reconnect()
263 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
271 ses->binding = true; in smb2_reconnect()
272 ses->binding_chan = cifs_ses_find_chan(ses, server); in smb2_reconnect()
275 rc = cifs_negotiate_protocol(0, tcon->ses); in smb2_reconnect()
276 if (!rc && tcon->ses->need_reconnect) { in smb2_reconnect()
277 rc = cifs_setup_session(0, tcon->ses, nls_codepage); in smb2_reconnect()
280 ses->binding = false; in smb2_reconnect()
281 ses->binding_chan = NULL; in smb2_reconnect()
282 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
289 ses->binding = false; in smb2_reconnect()
290 ses->binding_chan = NULL; in smb2_reconnect()
293 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
302 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
778 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) in SMB2_negotiate() argument
787 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_negotiate()
808 memset(ses->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE); in SMB2_negotiate()
832 if (ses->sign) in SMB2_negotiate()
859 rc = cifs_send_recv(xid, ses, server, in SMB2_negotiate()
931 memcpy(server->preauth_sha_hash, ses->preauth_sha_hash, in SMB2_negotiate()
963 rc = cifs_enable_signing(server, ses->sign); in SMB2_negotiate()
993 struct TCP_Server_Info *server = tcon->ses->server; in smb3_validate_negotiate()
1008 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) in smb3_validate_negotiate()
1011 if (tcon->ses->user_name == NULL) { in smb3_validate_negotiate()
1016 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) in smb3_validate_negotiate()
1028 if (tcon->ses->sign) in smb3_validate_negotiate()
1145 struct cifs_ses *ses; member
1166 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_alloc_buffer() local
1168 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_alloc_buffer()
1177 if (sess_data->ses->binding) { in SMB2_sess_alloc_buffer()
1178 req->sync_hdr.SessionId = sess_data->ses->Suid; in SMB2_sess_alloc_buffer()
1249 rc = cifs_send_recv(sess_data->xid, sess_data->ses, in SMB2_sess_sendreceive()
1250 cifs_ses_server(sess_data->ses), in SMB2_sess_sendreceive()
1264 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_establish_session() local
1265 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_establish_session()
1269 rc = server->ops->generate_signingkey(ses); in SMB2_sess_establish_session()
1285 if (!ses->binding) { in SMB2_sess_establish_session()
1287 ses->status = CifsGood; in SMB2_sess_establish_session()
1288 ses->need_reconnect = false; in SMB2_sess_establish_session()
1300 struct cifs_ses *ses = sess_data->ses; in SMB2_auth_kerberos() local
1309 spnego_key = cifs_get_spnego_key(ses); in SMB2_auth_kerberos()
1331 if (!ses->binding) { in SMB2_auth_kerberos()
1332 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, in SMB2_auth_kerberos()
1334 if (!ses->auth_key.response) { in SMB2_auth_kerberos()
1340 ses->auth_key.len = msg->sesskey_len; in SMB2_auth_kerberos()
1352 if (!ses->binding) { in SMB2_auth_kerberos()
1353 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_auth_kerberos()
1354 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_auth_kerberos()
1383 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_negotiate() local
1393 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); in SMB2_sess_auth_rawntlmssp_negotiate()
1394 if (!ses->ntlmssp) { in SMB2_sess_auth_rawntlmssp_negotiate()
1398 ses->ntlmssp->sesskey_per_smbsess = true; in SMB2_sess_auth_rawntlmssp_negotiate()
1411 build_ntlmssp_negotiate_blob(ntlmssp_blob, ses); in SMB2_sess_auth_rawntlmssp_negotiate()
1443 le16_to_cpu(rsp->SecurityBufferLength), ses); in SMB2_sess_auth_rawntlmssp_negotiate()
1450 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_negotiate()
1451 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_sess_auth_rawntlmssp_negotiate()
1452 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_negotiate()
1464 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_negotiate()
1465 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_negotiate()
1474 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_authenticate() local
1486 req->sync_hdr.SessionId = ses->Suid; in SMB2_sess_auth_rawntlmssp_authenticate()
1488 rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length, ses, in SMB2_sess_auth_rawntlmssp_authenticate()
1511 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_authenticate()
1512 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_sess_auth_rawntlmssp_authenticate()
1513 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_authenticate()
1518 if (ses->server->dialect < SMB30_PROT_ID) { in SMB2_sess_auth_rawntlmssp_authenticate()
1524 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid), in SMB2_sess_auth_rawntlmssp_authenticate()
1525 &ses->Suid); in SMB2_sess_auth_rawntlmssp_authenticate()
1527 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1529 SMB3_SIGN_KEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1535 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_authenticate()
1536 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_authenticate()
1542 SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data) in SMB2_select_sec() argument
1546 type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype); in SMB2_select_sec()
1569 SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, in SMB2_sess_setup() argument
1573 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_setup()
1587 rc = SMB2_select_sec(ses, sess_data); in SMB2_sess_setup()
1591 sess_data->ses = ses; in SMB2_sess_setup()
1594 sess_data->previous_session = ses->Suid; in SMB2_sess_setup()
1599 memcpy(ses->preauth_sha_hash, server->preauth_sha_hash, in SMB2_sess_setup()
1605 if ((ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) && (ses->sign)) in SMB2_sess_setup()
1614 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) in SMB2_logoff() argument
1626 cifs_dbg(FYI, "disconnect session %p\n", ses); in SMB2_logoff()
1628 if (ses && (ses->server)) in SMB2_logoff()
1629 server = ses->server; in SMB2_logoff()
1634 if (ses->need_reconnect) in SMB2_logoff()
1637 rc = smb2_plain_req_init(SMB2_LOGOFF, NULL, ses->server, in SMB2_logoff()
1643 req->sync_hdr.SessionId = ses->Suid; in SMB2_logoff()
1645 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) in SMB2_logoff()
1659 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_logoff()
1687 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, in SMB2_tcon() argument
1704 server = ses->server; in SMB2_tcon()
1753 !(ses->session_flags & in SMB2_tcon()
1755 ((ses->user_name != NULL) || (ses->sectype == Kerberos))) in SMB2_tcon()
1765 rc = cifs_send_recv(xid, ses, server, in SMB2_tcon()
1769 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc); in SMB2_tcon()
1834 struct cifs_ses *ses = tcon->ses; in SMB2_tdis() local
1843 if (!ses || !(ses->server)) in SMB2_tdis()
1846 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) in SMB2_tdis()
1851 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, ses->server, in SMB2_tdis()
1869 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_tdis()
2475 struct cifs_ses *ses = tcon->ses; in smb311_posix_mkdir() local
2489 struct TCP_Server_Info *server = cifs_pick_channel(ses); in smb311_posix_mkdir()
2498 if (!ses || !server) { in smb311_posix_mkdir()
2588 trace_smb3_posix_mkdir_enter(xid, tcon->tid, ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2591 rc = cifs_send_recv(xid, ses, server, in smb311_posix_mkdir()
2595 trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid, in smb311_posix_mkdir()
2603 ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2823 struct cifs_ses *ses = tcon->ses; in SMB2_open() local
2824 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_open()
2832 if (!ses || !server) in SMB2_open()
2848 trace_smb3_open_enter(xid, tcon->tid, tcon->ses->Suid, in SMB2_open()
2851 rc = cifs_send_recv(xid, ses, server, in SMB2_open()
2864 trace_smb3_open_err(xid, tcon->tid, ses->Suid, in SMB2_open()
2874 ses->Suid, oparms->create_options, in SMB2_open()
3018 struct cifs_ses *ses; in SMB2_ioctl() local
3038 ses = tcon->ses; in SMB2_ioctl()
3039 if (!ses) in SMB2_ioctl()
3042 server = cifs_pick_channel(ses); in SMB2_ioctl()
3060 rc = cifs_send_recv(xid, ses, server, in SMB2_ioctl()
3067 ses->Suid, 0, opcode, rc); in SMB2_ioctl()
3189 struct cifs_ses *ses = tcon->ses; in __SMB2_close() local
3190 struct TCP_Server_Info *server = cifs_pick_channel(ses); in __SMB2_close()
3200 if (!ses || !server) in __SMB2_close()
3215 trace_smb3_close_enter(xid, persistent_fid, tcon->tid, ses->Suid); in __SMB2_close()
3222 rc = cifs_send_recv(xid, ses, server, in __SMB2_close()
3228 trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid, in __SMB2_close()
3233 ses->Suid); in __SMB2_close()
3378 struct cifs_ses *ses = tcon->ses; in query_info() local
3385 if (!ses) in query_info()
3387 server = cifs_pick_channel(ses); in query_info()
3407 ses->Suid, info_class, (__u32)info_type); in query_info()
3409 rc = cifs_send_recv(xid, ses, server, in query_info()
3416 ses->Suid, info_class, (__u32)info_type, rc); in query_info()
3421 ses->Suid, info_class, (__u32)info_type); in query_info()
3544 struct cifs_ses *ses = tcon->ses; in SMB2_change_notify() local
3545 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_change_notify()
3554 if (!ses || !server) in SMB2_change_notify()
3571 trace_smb3_notify_enter(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3573 rc = cifs_send_recv(xid, ses, server, in SMB2_change_notify()
3578 trace_smb3_notify_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3582 ses->Suid, (u8)watch_tree, completion_filter); in SMB2_change_notify()
3621 struct cifs_ses *ses; in smb2_reconnect_server() local
3636 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in smb2_reconnect_server()
3637 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in smb2_reconnect_server()
3648 if (ses->tcon_ipc && ses->tcon_ipc->need_reconnect) { in smb2_reconnect_server()
3649 list_add_tail(&ses->tcon_ipc->rlist, &tmp_list); in smb2_reconnect_server()
3651 ses->ses_count++; in smb2_reconnect_server()
3671 cifs_put_smb_ses(tcon->ses); in smb2_reconnect_server()
3758 struct cifs_ses *ses = tcon->ses; in SMB2_flush() local
3762 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_flush()
3768 if (!ses || !(ses->server)) in SMB2_flush()
3784 trace_smb3_flush_enter(xid, persistent_fid, tcon->tid, ses->Suid); in SMB2_flush()
3785 rc = cifs_send_recv(xid, ses, server, in SMB2_flush()
3790 trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_flush()
3794 ses->Suid); in SMB2_flush()
3838 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in smb2_new_read_req()
3975 tcon->tid, tcon->ses->Suid, rdata->offset, in smb2_readv_callback()
3980 tcon->tid, tcon->ses->Suid, in smb2_readv_callback()
4006 rdata->server = cifs_pick_channel(tcon->ses); in smb2_async_readv()
4052 io_parms.tcon->ses->Suid, in smb2_async_readv()
4073 struct cifs_ses *ses = io_parms->tcon->ses; in SMB2_read() local
4076 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_read()
4093 rc = cifs_send_recv(xid, ses, io_parms->server, in SMB2_read()
4102 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4107 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4114 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4211 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_writev_callback()
4219 tcon->tid, tcon->ses->Suid, in smb2_writev_callback()
4242 server = wdata->server = cifs_pick_channel(tcon->ses); in smb2_async_writev()
4266 tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes); in smb2_async_writev()
4355 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_async_writev()
4392 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_write()
4419 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in SMB2_write()
4430 rc = cifs_send_recv(xid, io_parms->tcon->ses, server, in SMB2_write()
4438 io_parms->tcon->ses->Suid, in SMB2_write()
4446 io_parms->tcon->ses->Suid, in SMB2_write()
4669 tcon->ses->Suid, index, output_size); in SMB2_query_directory_init()
4764 struct cifs_ses *ses = tcon->ses; in SMB2_query_directory() local
4765 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_query_directory()
4768 if (!ses || !(ses->server)) in SMB2_query_directory()
4786 rc = cifs_send_recv(xid, ses, server, in SMB2_query_directory()
4794 tcon->tid, tcon->ses->Suid, index, 0); in SMB2_query_directory()
4799 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4809 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4815 tcon->ses->Suid, index, srch_inf->entries_in_buffer); in SMB2_query_directory()
4886 struct cifs_ses *ses = tcon->ses; in send_set_info() local
4887 struct TCP_Server_Info *server = cifs_pick_channel(ses); in send_set_info()
4890 if (!ses || !server) in send_set_info()
4917 rc = cifs_send_recv(xid, ses, server, in send_set_info()
4926 ses->Suid, info_class, (__u32)info_type, rc); in send_set_info()
4980 struct cifs_ses *ses = tcon->ses; in SMB2_oplock_break() local
4981 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_oplock_break()
5011 rc = cifs_send_recv(xid, ses, server, in SMB2_oplock_break()
5066 if ((tcon->ses == NULL) || server == NULL) in build_qfs_info_req()
5099 struct cifs_ses *ses = tcon->ses; in SMB311_posix_qfs_info() local
5100 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB311_posix_qfs_info()
5118 rc = cifs_send_recv(xid, ses, server, in SMB311_posix_qfs_info()
5150 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_info() local
5151 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_info()
5169 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_info()
5201 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_attr() local
5202 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_attr()
5236 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_attr()
5290 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in smb2_lockv()
5321 rc = cifs_send_recv(xid, tcon->ses, server, in smb2_lockv()
5329 tcon->ses->Suid, rc); in smb2_lockv()
5359 struct cifs_ses *ses = tcon->ses; in SMB2_lease_break() local
5367 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in SMB2_lease_break()
5394 rc = cifs_send_recv(xid, ses, server, in SMB2_lease_break()
5403 ses->Suid, *please_key_low, *please_key_high, rc); in SMB2_lease_break()
5407 ses->Suid, *please_key_low, *please_key_high); in SMB2_lease_break()