Skip to content

Commit 8266f53

Browse files
committed
Merge tag '6.5-rc2-smb3-client-fixes-ver2' of git://git.samba.org/sfrench/cifs-2.6
Pull smb client fix from Steve French: "Add minor debugging improvement. The change improves ability to read a network trace to debug problems on encrypted connections which are very common (e.g. using wireshark or tcpdump). That works today with tools like 'smbinfo keys /mnt/file' but requires passing in a filename on the mount (see e.g. [1]), but it often makes more sense to just pass in the mount point path (ie a directory not a filename). So this fix was needed to debug some types of problems (an obvious example is on an encrypted connection failing operations on an empty share or with no files in the root of the directory) - so you can simply pass in the 'smbinfo keys <mntpoint>' and get the information that wireshark needs" Link: https://wiki.samba.org/index.php/Wireshark_Decryption [1] * tag '6.5-rc2-smb3-client-fixes-ver2' of git://git.samba.org/sfrench/cifs-2.6: cifs: update internal module version number for cifs.ko cifs: allow dumping keys for directories too
2 parents c278253 + ba61a03 commit 8266f53

File tree

2 files changed

+15
-6
lines changed

2 files changed

+15
-6
lines changed

fs/smb/client/cifsfs.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,6 @@ extern const struct export_operations cifs_export_ops;
159159
#endif /* CONFIG_CIFS_NFSD_EXPORT */
160160

161161
/* when changing internal version - update following two lines at same time */
162-
#define SMB3_PRODUCT_BUILD 43
163-
#define CIFS_VERSION "2.43"
162+
#define SMB3_PRODUCT_BUILD 44
163+
#define CIFS_VERSION "2.44"
164164
#endif /* _CIFSFS_H */

fs/smb/client/ioctl.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -433,16 +433,21 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
433433
* Dump encryption keys. This is an old ioctl that only
434434
* handles AES-128-{CCM,GCM}.
435435
*/
436-
if (pSMBFile == NULL)
437-
break;
438436
if (!capable(CAP_SYS_ADMIN)) {
439437
rc = -EACCES;
440438
break;
441439
}
442440

443-
tcon = tlink_tcon(pSMBFile->tlink);
441+
cifs_sb = CIFS_SB(inode->i_sb);
442+
tlink = cifs_sb_tlink(cifs_sb);
443+
if (IS_ERR(tlink)) {
444+
rc = PTR_ERR(tlink);
445+
break;
446+
}
447+
tcon = tlink_tcon(tlink);
444448
if (!smb3_encryption_required(tcon)) {
445449
rc = -EOPNOTSUPP;
450+
cifs_put_tlink(tlink);
446451
break;
447452
}
448453
pkey_inf.cipher_type =
@@ -459,6 +464,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
459464
rc = -EFAULT;
460465
else
461466
rc = 0;
467+
cifs_put_tlink(tlink);
462468
break;
463469
case CIFS_DUMP_FULL_KEY:
464470
/*
@@ -470,8 +476,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
470476
rc = -EACCES;
471477
break;
472478
}
473-
tcon = tlink_tcon(pSMBFile->tlink);
479+
cifs_sb = CIFS_SB(inode->i_sb);
480+
tlink = cifs_sb_tlink(cifs_sb);
481+
tcon = tlink_tcon(tlink);
474482
rc = cifs_dump_full_key(tcon, (void __user *)arg);
483+
cifs_put_tlink(tlink);
475484
break;
476485
case CIFS_IOC_NOTIFY:
477486
if (!S_ISDIR(inode->i_mode)) {

0 commit comments

Comments
 (0)