• Home
  • Raw
  • Download

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()
285 mutex_unlock(&ses->session_mutex); in smb2_reconnect()
292 ses->binding = false; in smb2_reconnect()
293 ses->binding_chan = NULL; in smb2_reconnect()
296 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
305 mutex_unlock(&tcon->ses->session_mutex); in smb2_reconnect()
784 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses) in SMB2_negotiate() argument
793 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_negotiate()
814 memset(ses->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE); in SMB2_negotiate()
838 if (ses->sign) in SMB2_negotiate()
846 if (ses->chan_max > 1) in SMB2_negotiate()
867 rc = cifs_send_recv(xid, ses, server, in SMB2_negotiate()
939 memcpy(server->preauth_sha_hash, ses->preauth_sha_hash, in SMB2_negotiate()
978 rc = cifs_enable_signing(server, ses->sign); in SMB2_negotiate()
1008 struct TCP_Server_Info *server = tcon->ses->server; in smb3_validate_negotiate()
1023 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) in smb3_validate_negotiate()
1026 if (tcon->ses->user_name == NULL) { in smb3_validate_negotiate()
1031 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL) in smb3_validate_negotiate()
1040 if (tcon->ses->chan_max > 1) in smb3_validate_negotiate()
1046 if (tcon->ses->sign) in smb3_validate_negotiate()
1163 struct cifs_ses *ses; member
1184 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_alloc_buffer() local
1186 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_alloc_buffer()
1195 if (sess_data->ses->binding) { in SMB2_sess_alloc_buffer()
1196 req->sync_hdr.SessionId = sess_data->ses->Suid; in SMB2_sess_alloc_buffer()
1267 rc = cifs_send_recv(sess_data->xid, sess_data->ses, in SMB2_sess_sendreceive()
1268 cifs_ses_server(sess_data->ses), in SMB2_sess_sendreceive()
1282 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_establish_session() local
1283 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_establish_session()
1287 rc = server->ops->generate_signingkey(ses); in SMB2_sess_establish_session()
1303 if (!ses->binding) { in SMB2_sess_establish_session()
1305 ses->status = CifsGood; in SMB2_sess_establish_session()
1306 ses->need_reconnect = false; in SMB2_sess_establish_session()
1318 struct cifs_ses *ses = sess_data->ses; in SMB2_auth_kerberos() local
1327 spnego_key = cifs_get_spnego_key(ses); in SMB2_auth_kerberos()
1349 if (!ses->binding) { in SMB2_auth_kerberos()
1350 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len, in SMB2_auth_kerberos()
1352 if (!ses->auth_key.response) { in SMB2_auth_kerberos()
1358 ses->auth_key.len = msg->sesskey_len; in SMB2_auth_kerberos()
1370 if (!ses->binding) { in SMB2_auth_kerberos()
1371 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_auth_kerberos()
1372 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_auth_kerberos()
1401 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_negotiate() local
1411 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL); in SMB2_sess_auth_rawntlmssp_negotiate()
1412 if (!ses->ntlmssp) { in SMB2_sess_auth_rawntlmssp_negotiate()
1416 ses->ntlmssp->sesskey_per_smbsess = true; in SMB2_sess_auth_rawntlmssp_negotiate()
1429 build_ntlmssp_negotiate_blob(ntlmssp_blob, ses); in SMB2_sess_auth_rawntlmssp_negotiate()
1461 le16_to_cpu(rsp->SecurityBufferLength), ses); in SMB2_sess_auth_rawntlmssp_negotiate()
1468 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_negotiate()
1469 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_sess_auth_rawntlmssp_negotiate()
1470 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_negotiate()
1482 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_negotiate()
1483 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_negotiate()
1492 struct cifs_ses *ses = sess_data->ses; in SMB2_sess_auth_rawntlmssp_authenticate() local
1504 req->sync_hdr.SessionId = ses->Suid; in SMB2_sess_auth_rawntlmssp_authenticate()
1506 rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length, ses, in SMB2_sess_auth_rawntlmssp_authenticate()
1529 if (!ses->binding) { in SMB2_sess_auth_rawntlmssp_authenticate()
1530 ses->Suid = rsp->sync_hdr.SessionId; in SMB2_sess_auth_rawntlmssp_authenticate()
1531 ses->session_flags = le16_to_cpu(rsp->SessionFlags); in SMB2_sess_auth_rawntlmssp_authenticate()
1536 if (ses->server->dialect < SMB30_PROT_ID) { in SMB2_sess_auth_rawntlmssp_authenticate()
1542 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid), in SMB2_sess_auth_rawntlmssp_authenticate()
1543 &ses->Suid); in SMB2_sess_auth_rawntlmssp_authenticate()
1545 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1547 SMB3_SIGN_KEY_SIZE, ses->auth_key.response); in SMB2_sess_auth_rawntlmssp_authenticate()
1553 kfree(ses->ntlmssp); in SMB2_sess_auth_rawntlmssp_authenticate()
1554 ses->ntlmssp = NULL; in SMB2_sess_auth_rawntlmssp_authenticate()
1560 SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data) in SMB2_select_sec() argument
1564 type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype); in SMB2_select_sec()
1587 SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses, in SMB2_sess_setup() argument
1591 struct TCP_Server_Info *server = cifs_ses_server(ses); in SMB2_sess_setup()
1605 rc = SMB2_select_sec(ses, sess_data); in SMB2_sess_setup()
1609 sess_data->ses = ses; in SMB2_sess_setup()
1612 sess_data->previous_session = ses->Suid; in SMB2_sess_setup()
1617 memcpy(ses->preauth_sha_hash, server->preauth_sha_hash, in SMB2_sess_setup()
1623 if ((ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) && (ses->sign)) in SMB2_sess_setup()
1632 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses) in SMB2_logoff() argument
1644 cifs_dbg(FYI, "disconnect session %p\n", ses); in SMB2_logoff()
1646 if (ses && (ses->server)) in SMB2_logoff()
1647 server = ses->server; in SMB2_logoff()
1652 if (ses->need_reconnect) in SMB2_logoff()
1655 rc = smb2_plain_req_init(SMB2_LOGOFF, NULL, ses->server, in SMB2_logoff()
1661 req->sync_hdr.SessionId = ses->Suid; in SMB2_logoff()
1663 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) in SMB2_logoff()
1677 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_logoff()
1705 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree, in SMB2_tcon() argument
1722 server = ses->server; in SMB2_tcon()
1771 !(ses->session_flags & in SMB2_tcon()
1773 ((ses->user_name != NULL) || (ses->sectype == Kerberos))) in SMB2_tcon()
1783 rc = cifs_send_recv(xid, ses, server, in SMB2_tcon()
1787 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc); in SMB2_tcon()
1852 struct cifs_ses *ses = tcon->ses; in SMB2_tdis() local
1861 if (!ses || !(ses->server)) in SMB2_tdis()
1864 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect)) in SMB2_tdis()
1869 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, ses->server, in SMB2_tdis()
1887 rc = cifs_send_recv(xid, ses, ses->server, in SMB2_tdis()
2494 struct cifs_ses *ses = tcon->ses; in smb311_posix_mkdir() local
2508 struct TCP_Server_Info *server = cifs_pick_channel(ses); in smb311_posix_mkdir()
2517 if (!ses || !server) { in smb311_posix_mkdir()
2607 trace_smb3_posix_mkdir_enter(xid, tcon->tid, ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2610 rc = cifs_send_recv(xid, ses, server, in smb311_posix_mkdir()
2614 trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid, in smb311_posix_mkdir()
2622 ses->Suid, CREATE_NOT_FILE, in smb311_posix_mkdir()
2842 struct cifs_ses *ses = tcon->ses; in SMB2_open() local
2843 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_open()
2851 if (!ses || !server) in SMB2_open()
2867 trace_smb3_open_enter(xid, tcon->tid, tcon->ses->Suid, in SMB2_open()
2870 rc = cifs_send_recv(xid, ses, server, in SMB2_open()
2883 trace_smb3_open_err(xid, tcon->tid, ses->Suid, in SMB2_open()
2893 ses->Suid, oparms->create_options, in SMB2_open()
3035 struct cifs_ses *ses; in SMB2_ioctl() local
3055 ses = tcon->ses; in SMB2_ioctl()
3056 if (!ses) in SMB2_ioctl()
3059 server = cifs_pick_channel(ses); in SMB2_ioctl()
3077 rc = cifs_send_recv(xid, ses, server, in SMB2_ioctl()
3084 ses->Suid, 0, opcode, rc); in SMB2_ioctl()
3206 struct cifs_ses *ses = tcon->ses; in __SMB2_close() local
3207 struct TCP_Server_Info *server = cifs_pick_channel(ses); in __SMB2_close()
3217 if (!ses || !server) in __SMB2_close()
3232 trace_smb3_close_enter(xid, persistent_fid, tcon->tid, ses->Suid); in __SMB2_close()
3239 rc = cifs_send_recv(xid, ses, server, in __SMB2_close()
3245 trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid, in __SMB2_close()
3250 ses->Suid); in __SMB2_close()
3395 struct cifs_ses *ses = tcon->ses; in query_info() local
3402 if (!ses) in query_info()
3404 server = cifs_pick_channel(ses); in query_info()
3424 ses->Suid, info_class, (__u32)info_type); in query_info()
3426 rc = cifs_send_recv(xid, ses, server, in query_info()
3433 ses->Suid, info_class, (__u32)info_type, rc); in query_info()
3438 ses->Suid, info_class, (__u32)info_type); in query_info()
3561 struct cifs_ses *ses = tcon->ses; in SMB2_change_notify() local
3562 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_change_notify()
3571 if (!ses || !server) in SMB2_change_notify()
3588 trace_smb3_notify_enter(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3590 rc = cifs_send_recv(xid, ses, server, in SMB2_change_notify()
3595 trace_smb3_notify_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_change_notify()
3599 ses->Suid, (u8)watch_tree, completion_filter); in SMB2_change_notify()
3638 struct cifs_ses *ses; in smb2_reconnect_server() local
3653 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) { in smb2_reconnect_server()
3654 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) { in smb2_reconnect_server()
3665 if (ses->tcon_ipc && ses->tcon_ipc->need_reconnect) { in smb2_reconnect_server()
3666 list_add_tail(&ses->tcon_ipc->rlist, &tmp_list); in smb2_reconnect_server()
3668 ses->ses_count++; in smb2_reconnect_server()
3688 cifs_put_smb_ses(tcon->ses); in smb2_reconnect_server()
3775 struct cifs_ses *ses = tcon->ses; in SMB2_flush() local
3779 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_flush()
3785 if (!ses || !(ses->server)) in SMB2_flush()
3801 trace_smb3_flush_enter(xid, persistent_fid, tcon->tid, ses->Suid); in SMB2_flush()
3802 rc = cifs_send_recv(xid, ses, server, in SMB2_flush()
3807 trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid, in SMB2_flush()
3811 ses->Suid); in SMB2_flush()
3855 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in smb2_new_read_req()
3995 tcon->tid, tcon->ses->Suid, rdata->offset, in smb2_readv_callback()
4000 tcon->tid, tcon->ses->Suid, in smb2_readv_callback()
4026 rdata->server = cifs_pick_channel(tcon->ses); in smb2_async_readv()
4071 io_parms.tcon->ses->Suid, in smb2_async_readv()
4092 struct cifs_ses *ses = io_parms->tcon->ses; in SMB2_read() local
4095 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_read()
4112 rc = cifs_send_recv(xid, ses, io_parms->server, in SMB2_read()
4121 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4126 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4133 io_parms->tcon->tid, ses->Suid, in SMB2_read()
4230 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_writev_callback()
4238 tcon->tid, tcon->ses->Suid, in smb2_writev_callback()
4261 server = wdata->server = cifs_pick_channel(tcon->ses); in smb2_async_writev()
4285 tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes); in smb2_async_writev()
4373 tcon->tid, tcon->ses->Suid, wdata->offset, in smb2_async_writev()
4410 io_parms->server = cifs_pick_channel(io_parms->tcon->ses); in SMB2_write()
4437 io_parms->tcon->tid, io_parms->tcon->ses->Suid, in SMB2_write()
4448 rc = cifs_send_recv(xid, io_parms->tcon->ses, server, in SMB2_write()
4456 io_parms->tcon->ses->Suid, in SMB2_write()
4464 io_parms->tcon->ses->Suid, in SMB2_write()
4687 tcon->ses->Suid, index, output_size); in SMB2_query_directory_init()
4782 struct cifs_ses *ses = tcon->ses; in SMB2_query_directory() local
4783 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_query_directory()
4786 if (!ses || !(ses->server)) in SMB2_query_directory()
4804 rc = cifs_send_recv(xid, ses, server, in SMB2_query_directory()
4812 tcon->tid, tcon->ses->Suid, index, 0); in SMB2_query_directory()
4817 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4827 tcon->ses->Suid, index, 0, rc); in SMB2_query_directory()
4833 tcon->ses->Suid, index, srch_inf->entries_in_buffer); in SMB2_query_directory()
4904 struct cifs_ses *ses = tcon->ses; in send_set_info() local
4905 struct TCP_Server_Info *server = cifs_pick_channel(ses); in send_set_info()
4908 if (!ses || !server) in send_set_info()
4935 rc = cifs_send_recv(xid, ses, server, in send_set_info()
4944 ses->Suid, info_class, (__u32)info_type, rc); in send_set_info()
4998 struct cifs_ses *ses = tcon->ses; in SMB2_oplock_break() local
4999 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_oplock_break()
5029 rc = cifs_send_recv(xid, ses, server, in SMB2_oplock_break()
5084 if ((tcon->ses == NULL) || server == NULL) in build_qfs_info_req()
5117 struct cifs_ses *ses = tcon->ses; in SMB311_posix_qfs_info() local
5118 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB311_posix_qfs_info()
5136 rc = cifs_send_recv(xid, ses, server, in SMB311_posix_qfs_info()
5168 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_info() local
5169 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_info()
5187 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_info()
5219 struct cifs_ses *ses = tcon->ses; in SMB2_QFS_attr() local
5220 struct TCP_Server_Info *server = cifs_pick_channel(ses); in SMB2_QFS_attr()
5254 rc = cifs_send_recv(xid, ses, server, in SMB2_QFS_attr()
5308 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in smb2_lockv()
5339 rc = cifs_send_recv(xid, tcon->ses, server, in smb2_lockv()
5347 tcon->ses->Suid, rc); in smb2_lockv()
5377 struct cifs_ses *ses = tcon->ses; in SMB2_lease_break() local
5385 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses); in SMB2_lease_break()
5412 rc = cifs_send_recv(xid, ses, server, in SMB2_lease_break()
5421 ses->Suid, *please_key_low, *please_key_high, rc); in SMB2_lease_break()
5425 ses->Suid, *please_key_low, *please_key_high); in SMB2_lease_break()