Commit 8266f53b authored by Linus Torvalds's avatar Linus Torvalds

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
parents c2782531 ba61a03a
...@@ -159,6 +159,6 @@ extern const struct export_operations cifs_export_ops; ...@@ -159,6 +159,6 @@ extern const struct export_operations cifs_export_ops;
#endif /* CONFIG_CIFS_NFSD_EXPORT */ #endif /* CONFIG_CIFS_NFSD_EXPORT */
/* when changing internal version - update following two lines at same time */ /* when changing internal version - update following two lines at same time */
#define SMB3_PRODUCT_BUILD 43 #define SMB3_PRODUCT_BUILD 44
#define CIFS_VERSION "2.43" #define CIFS_VERSION "2.44"
#endif /* _CIFSFS_H */ #endif /* _CIFSFS_H */
...@@ -433,16 +433,21 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -433,16 +433,21 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
* Dump encryption keys. This is an old ioctl that only * Dump encryption keys. This is an old ioctl that only
* handles AES-128-{CCM,GCM}. * handles AES-128-{CCM,GCM}.
*/ */
if (pSMBFile == NULL)
break;
if (!capable(CAP_SYS_ADMIN)) { if (!capable(CAP_SYS_ADMIN)) {
rc = -EACCES; rc = -EACCES;
break; break;
} }
tcon = tlink_tcon(pSMBFile->tlink); cifs_sb = CIFS_SB(inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb);
if (IS_ERR(tlink)) {
rc = PTR_ERR(tlink);
break;
}
tcon = tlink_tcon(tlink);
if (!smb3_encryption_required(tcon)) { if (!smb3_encryption_required(tcon)) {
rc = -EOPNOTSUPP; rc = -EOPNOTSUPP;
cifs_put_tlink(tlink);
break; break;
} }
pkey_inf.cipher_type = pkey_inf.cipher_type =
...@@ -459,6 +464,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -459,6 +464,7 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = -EFAULT; rc = -EFAULT;
else else
rc = 0; rc = 0;
cifs_put_tlink(tlink);
break; break;
case CIFS_DUMP_FULL_KEY: case CIFS_DUMP_FULL_KEY:
/* /*
...@@ -470,8 +476,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg) ...@@ -470,8 +476,11 @@ long cifs_ioctl(struct file *filep, unsigned int command, unsigned long arg)
rc = -EACCES; rc = -EACCES;
break; break;
} }
tcon = tlink_tcon(pSMBFile->tlink); cifs_sb = CIFS_SB(inode->i_sb);
tlink = cifs_sb_tlink(cifs_sb);
tcon = tlink_tcon(tlink);
rc = cifs_dump_full_key(tcon, (void __user *)arg); rc = cifs_dump_full_key(tcon, (void __user *)arg);
cifs_put_tlink(tlink);
break; break;
case CIFS_IOC_NOTIFY: case CIFS_IOC_NOTIFY:
if (!S_ISDIR(inode->i_mode)) { if (!S_ISDIR(inode->i_mode)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment