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

Changed files
+15 -6
fs
smb
client
+2 -2
fs/smb/client/cifsfs.h
··· 159 159 #endif /* CONFIG_CIFS_NFSD_EXPORT */ 160 160 161 161 /* 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" 164 164 #endif /* _CIFSFS_H */
+13 -4
fs/smb/client/ioctl.c
··· 433 433 * Dump encryption keys. This is an old ioctl that only 434 434 * handles AES-128-{CCM,GCM}. 435 435 */ 436 - if (pSMBFile == NULL) 437 - break; 438 436 if (!capable(CAP_SYS_ADMIN)) { 439 437 rc = -EACCES; 440 438 break; 441 439 } 442 440 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); 444 448 if (!smb3_encryption_required(tcon)) { 445 449 rc = -EOPNOTSUPP; 450 + cifs_put_tlink(tlink); 446 451 break; 447 452 } 448 453 pkey_inf.cipher_type = ··· 464 459 rc = -EFAULT; 465 460 else 466 461 rc = 0; 462 + cifs_put_tlink(tlink); 467 463 break; 468 464 case CIFS_DUMP_FULL_KEY: 469 465 /* ··· 476 470 rc = -EACCES; 477 471 break; 478 472 } 479 - tcon = tlink_tcon(pSMBFile->tlink); 473 + cifs_sb = CIFS_SB(inode->i_sb); 474 + tlink = cifs_sb_tlink(cifs_sb); 475 + tcon = tlink_tcon(tlink); 480 476 rc = cifs_dump_full_key(tcon, (void __user *)arg); 477 + cifs_put_tlink(tlink); 481 478 break; 482 479 case CIFS_IOC_NOTIFY: 483 480 if (!S_ISDIR(inode->i_mode)) {