Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag '6.5-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6

Pull smb client fixes from Steve French:
"Four small SMB3 client fixes:

- two reconnect fixes (to address the case where non-default
iocharset gets incorrectly overridden at reconnect with the
default charset)

- fix for NTLMSSP_AUTH request setting a flag incorrectly)

- Add missing check for invalid tlink (tree connection) in ioctl"

* tag '6.5-rc3-smb3-client-fixes' of git://git.samba.org/sfrench/cifs-2.6:
cifs: add missing return value check for cifs_sb_tlink
smb3: do not set NTLMSSP_VERSION flag for negotiate not auth request
cifs: fix charset issue in reconnection
fs/nls: make load_nls() take a const parameter

+20 -8
+2 -2
fs/nls/nls_base.c
··· 272 272 return -EINVAL; 273 273 } 274 274 275 - static struct nls_table *find_nls(char *charset) 275 + static struct nls_table *find_nls(const char *charset) 276 276 { 277 277 struct nls_table *nls; 278 278 spin_lock(&nls_lock); ··· 288 288 return nls; 289 289 } 290 290 291 - struct nls_table *load_nls(char *charset) 291 + struct nls_table *load_nls(const char *charset) 292 292 { 293 293 return try_then_request_module(find_nls(charset), "nls_%s", charset); 294 294 }
+1
fs/smb/client/cifsglob.h
··· 1062 1062 unsigned long chans_need_reconnect; 1063 1063 /* ========= end: protected by chan_lock ======== */ 1064 1064 struct cifs_ses *dfs_root_ses; 1065 + struct nls_table *local_nls; 1065 1066 }; 1066 1067 1067 1068 static inline bool
+1 -2
fs/smb/client/cifssmb.c
··· 129 129 } 130 130 spin_unlock(&server->srv_lock); 131 131 132 - nls_codepage = load_nls_default(); 132 + nls_codepage = ses->local_nls; 133 133 134 134 /* 135 135 * need to prevent multiple threads trying to simultaneously ··· 200 200 rc = -EAGAIN; 201 201 } 202 202 203 - unload_nls(nls_codepage); 204 203 return rc; 205 204 } 206 205
+5
fs/smb/client/connect.c
··· 1842 1842 CIFS_MAX_PASSWORD_LEN)) 1843 1843 return 0; 1844 1844 } 1845 + 1846 + if (strcmp(ctx->local_nls->charset, ses->local_nls->charset)) 1847 + return 0; 1848 + 1845 1849 return 1; 1846 1850 } 1847 1851 ··· 2290 2286 2291 2287 ses->sectype = ctx->sectype; 2292 2288 ses->sign = ctx->sign; 2289 + ses->local_nls = load_nls(ctx->local_nls->charset); 2293 2290 2294 2291 /* add server as first channel */ 2295 2292 spin_lock(&ses->chan_lock);
+5
fs/smb/client/ioctl.c
··· 478 478 } 479 479 cifs_sb = CIFS_SB(inode->i_sb); 480 480 tlink = cifs_sb_tlink(cifs_sb); 481 + if (IS_ERR(tlink)) { 482 + rc = PTR_ERR(tlink); 483 + break; 484 + } 485 + 481 486 tcon = tlink_tcon(tlink); 482 487 rc = cifs_dump_full_key(tcon, (void __user *)arg); 483 488 cifs_put_tlink(tlink);
+1
fs/smb/client/misc.c
··· 95 95 return; 96 96 } 97 97 98 + unload_nls(buf_to_free->local_nls); 98 99 atomic_dec(&sesInfoAllocCount); 99 100 kfree(buf_to_free->serverOS); 100 101 kfree(buf_to_free->serverDomain);
+3 -1
fs/smb/client/sess.c
··· 1013 1013 } 1014 1014 1015 1015 1016 + /* See MS-NLMP 2.2.1.3 */ 1016 1017 int build_ntlmssp_auth_blob(unsigned char **pbuffer, 1017 1018 u16 *buflen, 1018 1019 struct cifs_ses *ses, ··· 1048 1047 1049 1048 flags = ses->ntlmssp->server_flags | NTLMSSP_REQUEST_TARGET | 1050 1049 NTLMSSP_NEGOTIATE_TARGET_INFO | NTLMSSP_NEGOTIATE_WORKSTATION_SUPPLIED; 1051 - 1050 + /* we only send version information in ntlmssp negotiate, so do not set this flag */ 1051 + flags = flags & ~NTLMSSP_NEGOTIATE_VERSION; 1052 1052 tmp = *pbuffer + sizeof(AUTHENTICATE_MESSAGE); 1053 1053 sec_blob->NegotiateFlags = cpu_to_le32(flags); 1054 1054
+1 -2
fs/smb/client/smb2pdu.c
··· 242 242 } 243 243 spin_unlock(&server->srv_lock); 244 244 245 - nls_codepage = load_nls_default(); 245 + nls_codepage = ses->local_nls; 246 246 247 247 /* 248 248 * need to prevent multiple threads trying to simultaneously ··· 324 324 rc = -EAGAIN; 325 325 } 326 326 failed: 327 - unload_nls(nls_codepage); 328 327 return rc; 329 328 } 330 329
+1 -1
include/linux/nls.h
··· 47 47 /* nls_base.c */ 48 48 extern int __register_nls(struct nls_table *, struct module *); 49 49 extern int unregister_nls(struct nls_table *); 50 - extern struct nls_table *load_nls(char *); 50 + extern struct nls_table *load_nls(const char *charset); 51 51 extern void unload_nls(struct nls_table *); 52 52 extern struct nls_table *load_nls_default(void); 53 53 #define register_nls(nls) __register_nls((nls), THIS_MODULE)