Lines Matching refs:ses

88 	if (!tcon || !tcon->ses)
90 if ((tcon->ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA) ||
94 (tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION))
133 if (tcon->ses)
134 shdr->SessionId = tcon->ses->Suid;
161 struct cifs_ses *ses;
189 if ((!tcon->ses) || (tcon->ses->status == CifsExiting) ||
190 (!tcon->ses->server) || !server)
193 ses = tcon->ses;
245 if (!tcon->ses->need_reconnect && !tcon->need_reconnect)
254 mutex_lock(&tcon->ses->session_mutex);
263 mutex_unlock(&tcon->ses->session_mutex);
271 ses->binding = true;
272 ses->binding_chan = cifs_ses_find_chan(ses, server);
275 rc = cifs_negotiate_protocol(0, tcon->ses);
276 if (!rc && tcon->ses->need_reconnect) {
277 rc = cifs_setup_session(0, tcon->ses, nls_codepage);
280 ses->binding = false;
281 ses->binding_chan = NULL;
282 mutex_unlock(&tcon->ses->session_mutex);
285 mutex_unlock(&ses->session_mutex);
292 ses->binding = false;
293 ses->binding_chan = NULL;
296 mutex_unlock(&tcon->ses->session_mutex);
305 mutex_unlock(&tcon->ses->session_mutex);
789 SMB2_negotiate(const unsigned int xid, struct cifs_ses *ses)
798 struct TCP_Server_Info *server = cifs_ses_server(ses);
819 memset(ses->preauth_sha_hash, 0, SMB2_PREAUTH_HASH_SIZE);
843 if (ses->sign)
851 if (ses->chan_max > 1)
872 rc = cifs_send_recv(xid, ses, server,
944 memcpy(server->preauth_sha_hash, ses->preauth_sha_hash,
974 * ses->sectype = RawNTLMSSP;
983 rc = cifs_enable_signing(server, ses->sign);
1013 struct TCP_Server_Info *server = tcon->ses->server;
1028 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST)
1031 if (tcon->ses->user_name == NULL) {
1036 if (tcon->ses->session_flags & SMB2_SESSION_FLAG_IS_NULL)
1045 if (tcon->ses->chan_max > 1)
1051 if (tcon->ses->sign)
1168 struct cifs_ses *ses;
1189 struct cifs_ses *ses = sess_data->ses;
1191 struct TCP_Server_Info *server = cifs_ses_server(ses);
1200 if (sess_data->ses->binding) {
1201 req->sync_hdr.SessionId = sess_data->ses->Suid;
1272 rc = cifs_send_recv(sess_data->xid, sess_data->ses,
1273 cifs_ses_server(sess_data->ses),
1287 struct cifs_ses *ses = sess_data->ses;
1288 struct TCP_Server_Info *server = cifs_ses_server(ses);
1292 rc = server->ops->generate_signingkey(ses);
1307 /* keep existing ses state if binding */
1308 if (!ses->binding) {
1310 ses->status = CifsGood;
1311 ses->need_reconnect = false;
1323 struct cifs_ses *ses = sess_data->ses;
1332 spnego_key = cifs_get_spnego_key(ses);
1354 if (!ses->binding) {
1355 ses->auth_key.response = kmemdup(msg->data, msg->sesskey_len,
1357 if (!ses->auth_key.response) {
1363 ses->auth_key.len = msg->sesskey_len;
1375 if (!ses->binding) {
1376 ses->Suid = rsp->sync_hdr.SessionId;
1377 ses->session_flags = le16_to_cpu(rsp->SessionFlags);
1406 struct cifs_ses *ses = sess_data->ses;
1416 ses->ntlmssp = kmalloc(sizeof(struct ntlmssp_auth), GFP_KERNEL);
1417 if (!ses->ntlmssp) {
1421 ses->ntlmssp->sesskey_per_smbsess = true;
1434 build_ntlmssp_negotiate_blob(ntlmssp_blob, ses);
1466 le16_to_cpu(rsp->SecurityBufferLength), ses);
1472 /* keep existing ses id and flags if binding */
1473 if (!ses->binding) {
1474 ses->Suid = rsp->sync_hdr.SessionId;
1475 ses->session_flags = le16_to_cpu(rsp->SessionFlags);
1487 kfree(ses->ntlmssp);
1488 ses->ntlmssp = NULL;
1497 struct cifs_ses *ses = sess_data->ses;
1509 req->sync_hdr.SessionId = ses->Suid;
1511 rc = build_ntlmssp_auth_blob(&ntlmssp_blob, &blob_length, ses,
1533 /* keep existing ses id and flags if binding */
1534 if (!ses->binding) {
1535 ses->Suid = rsp->sync_hdr.SessionId;
1536 ses->session_flags = le16_to_cpu(rsp->SessionFlags);
1541 if (ses->server->dialect < SMB30_PROT_ID) {
1547 cifs_dbg(VFS, "Session Id %*ph\n", (int)sizeof(ses->Suid),
1548 &ses->Suid);
1550 SMB2_NTLMV2_SESSKEY_SIZE, ses->auth_key.response);
1552 SMB3_SIGN_KEY_SIZE, ses->auth_key.response);
1558 kfree(ses->ntlmssp);
1559 ses->ntlmssp = NULL;
1565 SMB2_select_sec(struct cifs_ses *ses, struct SMB2_sess_data *sess_data)
1569 type = smb2_select_sectype(cifs_ses_server(ses), ses->sectype);
1592 SMB2_sess_setup(const unsigned int xid, struct cifs_ses *ses,
1596 struct TCP_Server_Info *server = cifs_ses_server(ses);
1610 rc = SMB2_select_sec(ses, sess_data);
1614 sess_data->ses = ses;
1617 sess_data->previous_session = ses->Suid;
1622 memcpy(ses->preauth_sha_hash, server->preauth_sha_hash,
1628 if ((ses->session_flags & SMB2_SESSION_FLAG_IS_GUEST) && (ses->sign))
1637 SMB2_logoff(const unsigned int xid, struct cifs_ses *ses)
1649 cifs_dbg(FYI, "disconnect session %p\n", ses);
1651 if (ses && (ses->server))
1652 server = ses->server;
1657 if (ses->need_reconnect)
1660 rc = smb2_plain_req_init(SMB2_LOGOFF, NULL, ses->server,
1666 req->sync_hdr.SessionId = ses->Suid;
1668 if (ses->session_flags & SMB2_SESSION_FLAG_ENCRYPT_DATA)
1682 rc = cifs_send_recv(xid, ses, ses->server,
1710 SMB2_tcon(const unsigned int xid, struct cifs_ses *ses, const char *tree,
1727 server = ses->server;
1775 !(ses->session_flags &
1777 ((ses->user_name != NULL) || (ses->sectype == Kerberos)))
1787 rc = cifs_send_recv(xid, ses, server,
1791 trace_smb3_tcon(xid, tcon->tid, ses->Suid, tree, rc);
1856 struct cifs_ses *ses = tcon->ses;
1865 if (!ses || !(ses->server))
1868 if ((tcon->need_reconnect) || (tcon->ses->need_reconnect))
1873 rc = smb2_plain_req_init(SMB2_TREE_DISCONNECT, tcon, ses->server,
1891 rc = cifs_send_recv(xid, ses, ses->server,
2498 struct cifs_ses *ses = tcon->ses;
2512 struct TCP_Server_Info *server = cifs_pick_channel(ses);
2521 if (!ses || !server) {
2611 trace_smb3_posix_mkdir_enter(xid, tcon->tid, ses->Suid, CREATE_NOT_FILE,
2614 rc = cifs_send_recv(xid, ses, server,
2618 trace_smb3_posix_mkdir_err(xid, tcon->tid, ses->Suid,
2626 ses->Suid, CREATE_NOT_FILE,
2846 struct cifs_ses *ses = tcon->ses;
2847 struct TCP_Server_Info *server = cifs_pick_channel(ses);
2855 if (!ses || !server)
2871 trace_smb3_open_enter(xid, tcon->tid, tcon->ses->Suid,
2874 rc = cifs_send_recv(xid, ses, server,
2887 trace_smb3_open_err(xid, tcon->tid, ses->Suid,
2897 ses->Suid, oparms->create_options,
3039 struct cifs_ses *ses;
3059 ses = tcon->ses;
3060 if (!ses)
3063 server = cifs_pick_channel(ses);
3081 rc = cifs_send_recv(xid, ses, server,
3088 ses->Suid, 0, opcode, rc);
3210 struct cifs_ses *ses = tcon->ses;
3211 struct TCP_Server_Info *server = cifs_pick_channel(ses);
3221 if (!ses || !server)
3236 trace_smb3_close_enter(xid, persistent_fid, tcon->tid, ses->Suid);
3243 rc = cifs_send_recv(xid, ses, server,
3249 trace_smb3_close_err(xid, persistent_fid, tcon->tid, ses->Suid,
3254 ses->Suid);
3404 struct cifs_ses *ses = tcon->ses;
3411 if (!ses)
3413 server = cifs_pick_channel(ses);
3433 ses->Suid, info_class, (__u32)info_type);
3435 rc = cifs_send_recv(xid, ses, server,
3442 ses->Suid, info_class, (__u32)info_type, rc);
3447 ses->Suid, info_class, (__u32)info_type);
3570 struct cifs_ses *ses = tcon->ses;
3571 struct TCP_Server_Info *server = cifs_pick_channel(ses);
3580 if (!ses || !server)
3597 trace_smb3_notify_enter(xid, persistent_fid, tcon->tid, ses->Suid,
3599 rc = cifs_send_recv(xid, ses, server,
3604 trace_smb3_notify_err(xid, persistent_fid, tcon->tid, ses->Suid,
3608 ses->Suid, (u8)watch_tree, completion_filter);
3647 struct cifs_ses *ses;
3662 list_for_each_entry(ses, &server->smb_ses_list, smb_ses_list) {
3663 list_for_each_entry(tcon, &ses->tcon_list, tcon_list) {
3674 if (ses->tcon_ipc && ses->tcon_ipc->need_reconnect) {
3675 list_add_tail(&ses->tcon_ipc->rlist, &tmp_list);
3677 ses->ses_count++;
3697 cifs_put_smb_ses(tcon->ses);
3784 struct cifs_ses *ses = tcon->ses;
3788 struct TCP_Server_Info *server = cifs_pick_channel(ses);
3794 if (!ses || !(ses->server))
3810 trace_smb3_flush_enter(xid, persistent_fid, tcon->tid, ses->Suid);
3811 rc = cifs_send_recv(xid, ses, server,
3816 trace_smb3_flush_err(xid, persistent_fid, tcon->tid, ses->Suid,
3820 ses->Suid);
3864 io_parms->tcon->tid, io_parms->tcon->ses->Suid,
4004 tcon->tid, tcon->ses->Suid, rdata->offset,
4009 tcon->tid, tcon->ses->Suid,
4035 rdata->server = cifs_pick_channel(tcon->ses);
4080 io_parms.tcon->ses->Suid,
4101 struct cifs_ses *ses = io_parms->tcon->ses;
4104 io_parms->server = cifs_pick_channel(io_parms->tcon->ses);
4121 rc = cifs_send_recv(xid, ses, io_parms->server,
4130 io_parms->tcon->tid, ses->Suid,
4135 io_parms->tcon->tid, ses->Suid,
4142 io_parms->tcon->tid, ses->Suid,
4239 tcon->tid, tcon->ses->Suid, wdata->offset,
4247 tcon->tid, tcon->ses->Suid,
4270 server = wdata->server = cifs_pick_channel(tcon->ses);
4294 tcon->tid, tcon->ses->Suid, wdata->offset, wdata->bytes);
4382 tcon->tid, tcon->ses->Suid, wdata->offset,
4419 io_parms->server = cifs_pick_channel(io_parms->tcon->ses);
4446 io_parms->tcon->tid, io_parms->tcon->ses->Suid,
4457 rc = cifs_send_recv(xid, io_parms->tcon->ses, server,
4465 io_parms->tcon->ses->Suid,
4473 io_parms->tcon->ses->Suid,
4696 tcon->ses->Suid, index, output_size);
4791 struct cifs_ses *ses = tcon->ses;
4792 struct TCP_Server_Info *server = cifs_pick_channel(ses);
4795 if (!ses || !(ses->server))
4813 rc = cifs_send_recv(xid, ses, server,
4821 tcon->tid, tcon->ses->Suid, index, 0);
4826 tcon->ses->Suid, index, 0, rc);
4836 tcon->ses->Suid, index, 0, rc);
4842 tcon->ses->Suid, index, srch_inf->entries_in_buffer);
4913 struct cifs_ses *ses = tcon->ses;
4914 struct TCP_Server_Info *server = cifs_pick_channel(ses);
4917 if (!ses || !server)
4944 rc = cifs_send_recv(xid, ses, server,
4953 ses->Suid, info_class, (__u32)info_type, rc);
5007 struct cifs_ses *ses = tcon->ses;
5008 struct TCP_Server_Info *server = cifs_pick_channel(ses);
5038 rc = cifs_send_recv(xid, ses, server,
5093 if ((tcon->ses == NULL) || server == NULL)
5131 struct cifs_ses *ses = tcon->ses;
5132 struct TCP_Server_Info *server = cifs_pick_channel(ses);
5150 rc = cifs_send_recv(xid, ses, server,
5182 struct cifs_ses *ses = tcon->ses;
5183 struct TCP_Server_Info *server = cifs_pick_channel(ses);
5201 rc = cifs_send_recv(xid, ses, server,
5233 struct cifs_ses *ses = tcon->ses;
5234 struct TCP_Server_Info *server = cifs_pick_channel(ses);
5268 rc = cifs_send_recv(xid, ses, server,
5322 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
5353 rc = cifs_send_recv(xid, tcon->ses, server,
5361 tcon->ses->Suid, rc);
5391 struct cifs_ses *ses = tcon->ses;
5399 struct TCP_Server_Info *server = cifs_pick_channel(tcon->ses);
5426 rc = cifs_send_recv(xid, ses, server,
5435 ses->Suid, *please_key_low, *please_key_high, rc);
5439 ses->Suid, *please_key_low, *please_key_high);