Skip to content

Commit 34ac1e8

Browse files
committed
Merge tag '6.11-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fixes from Steve French: - DFS fix - fix for security flags for requiring encryption - minor cleanup * tag '6.11-rc2-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6: cifs: cifs_inval_name_dfs_link_error: correct the check for fullpath Fix spelling errors in Server Message Block smb3: fix setting SecurityFlags when encryption is required
2 parents 57b935e + 36bb22a commit 34ac1e8

File tree

7 files changed

+22
-18
lines changed

7 files changed

+22
-18
lines changed

Documentation/admin-guide/cifs/usage.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ SecurityFlags Flags which control security negotiation and
742742
may use NTLMSSP 0x00080
743743
must use NTLMSSP 0x80080
744744
seal (packet encryption) 0x00040
745-
must seal (not implemented yet) 0x40040
745+
must seal 0x40040
746746

747747
cifsFYI If set to non-zero value, additional debug information
748748
will be logged to the system error log. This field

fs/smb/client/cifs_debug.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1072,7 +1072,7 @@ static int cifs_security_flags_proc_open(struct inode *inode, struct file *file)
10721072
static void
10731073
cifs_security_flags_handle_must_flags(unsigned int *flags)
10741074
{
1075-
unsigned int signflags = *flags & CIFSSEC_MUST_SIGN;
1075+
unsigned int signflags = *flags & (CIFSSEC_MUST_SIGN | CIFSSEC_MUST_SEAL);
10761076

10771077
if ((*flags & CIFSSEC_MUST_KRB5) == CIFSSEC_MUST_KRB5)
10781078
*flags = CIFSSEC_MUST_KRB5;

fs/smb/client/cifsglob.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ struct smb_version_operations {
345345
/* connect to a server share */
346346
int (*tree_connect)(const unsigned int, struct cifs_ses *, const char *,
347347
struct cifs_tcon *, const struct nls_table *);
348-
/* close tree connecion */
348+
/* close tree connection */
349349
int (*tree_disconnect)(const unsigned int, struct cifs_tcon *);
350350
/* get DFS referrals */
351351
int (*get_dfs_refer)(const unsigned int, struct cifs_ses *,
@@ -816,7 +816,7 @@ struct TCP_Server_Info {
816816
* Protected by @refpath_lock and @srv_lock. The @refpath_lock is
817817
* mostly used for not requiring a copy of @leaf_fullpath when getting
818818
* cached or new DFS referrals (which might also sleep during I/O).
819-
* While @srv_lock is held for making string and NULL comparions against
819+
* While @srv_lock is held for making string and NULL comparisons against
820820
* both fields as in mount(2) and cache refresh.
821821
*
822822
* format: \\HOST\SHARE[\OPTIONAL PATH]
@@ -1881,7 +1881,7 @@ static inline bool is_replayable_error(int error)
18811881
#define CIFSSEC_MAY_SIGN 0x00001
18821882
#define CIFSSEC_MAY_NTLMV2 0x00004
18831883
#define CIFSSEC_MAY_KRB5 0x00008
1884-
#define CIFSSEC_MAY_SEAL 0x00040 /* not supported yet */
1884+
#define CIFSSEC_MAY_SEAL 0x00040
18851885
#define CIFSSEC_MAY_NTLMSSP 0x00080 /* raw ntlmssp with ntlmv2 */
18861886

18871887
#define CIFSSEC_MUST_SIGN 0x01001
@@ -1891,11 +1891,11 @@ require use of the stronger protocol */
18911891
#define CIFSSEC_MUST_NTLMV2 0x04004
18921892
#define CIFSSEC_MUST_KRB5 0x08008
18931893
#ifdef CONFIG_CIFS_UPCALL
1894-
#define CIFSSEC_MASK 0x8F08F /* flags supported if no weak allowed */
1894+
#define CIFSSEC_MASK 0xCF0CF /* flags supported if no weak allowed */
18951895
#else
1896-
#define CIFSSEC_MASK 0x87087 /* flags supported if no weak allowed */
1896+
#define CIFSSEC_MASK 0xC70C7 /* flags supported if no weak allowed */
18971897
#endif /* UPCALL */
1898-
#define CIFSSEC_MUST_SEAL 0x40040 /* not supported yet */
1898+
#define CIFSSEC_MUST_SEAL 0x40040
18991899
#define CIFSSEC_MUST_NTLMSSP 0x80080 /* raw ntlmssp with ntlmv2 */
19001900

19011901
#define CIFSSEC_DEF (CIFSSEC_MAY_SIGN | CIFSSEC_MAY_NTLMV2 | CIFSSEC_MAY_NTLMSSP | CIFSSEC_MAY_SEAL)

fs/smb/client/misc.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ checkSMB(char *buf, unsigned int total_read, struct TCP_Server_Info *server)
352352
* on simple responses (wct, bcc both zero)
353353
* in particular have seen this on
354354
* ulogoffX and FindClose. This leaves
355-
* one byte of bcc potentially unitialized
355+
* one byte of bcc potentially uninitialized
356356
*/
357357
/* zero rest of bcc */
358358
tmp[sizeof(struct smb_hdr)+1] = 0;
@@ -1234,6 +1234,7 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid,
12341234
const char *full_path,
12351235
bool *islink)
12361236
{
1237+
struct TCP_Server_Info *server = tcon->ses->server;
12371238
struct cifs_ses *ses = tcon->ses;
12381239
size_t len;
12391240
char *path;
@@ -1250,12 +1251,12 @@ int cifs_inval_name_dfs_link_error(const unsigned int xid,
12501251
!is_tcon_dfs(tcon))
12511252
return 0;
12521253

1253-
spin_lock(&tcon->tc_lock);
1254-
if (!tcon->origin_fullpath) {
1255-
spin_unlock(&tcon->tc_lock);
1254+
spin_lock(&server->srv_lock);
1255+
if (!server->leaf_fullpath) {
1256+
spin_unlock(&server->srv_lock);
12561257
return 0;
12571258
}
1258-
spin_unlock(&tcon->tc_lock);
1259+
spin_unlock(&server->srv_lock);
12591260

12601261
/*
12611262
* Slow path - tcon is DFS and @full_path has prefix path, so attempt

fs/smb/client/smb2pdu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ int smb3_encryption_required(const struct cifs_tcon *tcon)
8282
if (tcon->seal &&
8383
(tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION))
8484
return 1;
85+
if (((global_secflags & CIFSSEC_MUST_SEAL) == CIFSSEC_MUST_SEAL) &&
86+
(tcon->ses->server->capabilities & SMB2_GLOBAL_CAP_ENCRYPTION))
87+
return 1;
8588
return 0;
8689
}
8790

fs/smb/client/smbdirect.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ static void smbd_post_send_credits(struct work_struct *work)
406406
else
407407
response = get_empty_queue_buffer(info);
408408
if (!response) {
409-
/* now switch to emtpy packet queue */
409+
/* now switch to empty packet queue */
410410
if (use_receive_queue) {
411411
use_receive_queue = 0;
412412
continue;
@@ -618,7 +618,7 @@ static struct rdma_cm_id *smbd_create_id(
618618

619619
/*
620620
* Test if FRWR (Fast Registration Work Requests) is supported on the device
621-
* This implementation requries FRWR on RDMA read/write
621+
* This implementation requires FRWR on RDMA read/write
622622
* return value: true if it is supported
623623
*/
624624
static bool frwr_is_supported(struct ib_device_attr *attrs)
@@ -2177,7 +2177,7 @@ static int allocate_mr_list(struct smbd_connection *info)
21772177
* MR available in the list. It may access the list while the
21782178
* smbd_mr_recovery_work is recovering the MR list. This doesn't need a lock
21792179
* as they never modify the same places. However, there may be several CPUs
2180-
* issueing I/O trying to get MR at the same time, mr_list_lock is used to
2180+
* issuing I/O trying to get MR at the same time, mr_list_lock is used to
21812181
* protect this situation.
21822182
*/
21832183
static struct smbd_mr *get_mr(struct smbd_connection *info)
@@ -2311,7 +2311,7 @@ struct smbd_mr *smbd_register_mr(struct smbd_connection *info,
23112311
/*
23122312
* There is no need for waiting for complemtion on ib_post_send
23132313
* on IB_WR_REG_MR. Hardware enforces a barrier and order of execution
2314-
* on the next ib_post_send when we actaully send I/O to remote peer
2314+
* on the next ib_post_send when we actually send I/O to remote peer
23152315
*/
23162316
rc = ib_post_send(info->id->qp, &reg_wr->wr, NULL);
23172317
if (!rc)

fs/smb/client/transport.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1289,7 +1289,7 @@ compound_send_recv(const unsigned int xid, struct cifs_ses *ses,
12891289
out:
12901290
/*
12911291
* This will dequeue all mids. After this it is important that the
1292-
* demultiplex_thread will not process any of these mids any futher.
1292+
* demultiplex_thread will not process any of these mids any further.
12931293
* This is prevented above by using a noop callback that will not
12941294
* wake this thread except for the very last PDU.
12951295
*/

0 commit comments

Comments
 (0)