Skip to content

Commit ae9b728

Browse files
committed
Merge tag '4.3-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6
Pull cifs updates from Steve French: "Fixes (three for stable) and improvements including much faster encryption (SMB3.1.1 GCM)" * tag '4.3-rc-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6: (27 commits) smb3: smbdirect no longer experimental cifs: fix crash in smb2_compound_op()/smb2_set_next_command() cifs: fix crash in cifs_dfs_do_automount cifs: fix parsing of symbolic link error response cifs: refactor and clean up arguments in the reparse point parsing SMB3: query inode number on open via create context smb3: Send netname context during negotiate protocol smb3: do not send compression info by default smb3: add new mount option to retrieve mode from special ACE smb3: Allow query of symlinks stored as reparse points cifs: Fix a race condition with cifs_echo_request cifs: always add credits back for unsolicited PDUs fs: cifs: cifsssmb: Change return type of convert_ace_to_cifs_ace add some missing definitions cifs: fix typo in debug message with struct field ia_valid smb3: minor cleanup of compound_send_recv CIFS: Fix module dependency cifs: simplify code by removing CONFIG_CIFS_ACL ifdef cifs: Fix check for matching with existing mount cifs: Properly handle auto disabling of serverino option ...
2 parents d9b9c89 + e963066 commit ae9b728

19 files changed

+335
-153
lines changed

fs/cifs/Kconfig

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ config CIFS
1313
select CRYPTO_LIB_ARC4
1414
select CRYPTO_AEAD2
1515
select CRYPTO_CCM
16+
select CRYPTO_GCM
1617
select CRYPTO_ECB
1718
select CRYPTO_AES
1819
select CRYPTO_DES
20+
select KEYS
1921
help
2022
This is the client VFS module for the SMB3 family of NAS protocols,
2123
(including support for the most recent, most secure dialect SMB3.1.1)
@@ -109,7 +111,7 @@ config CIFS_WEAK_PW_HASH
109111

110112
config CIFS_UPCALL
111113
bool "Kerberos/SPNEGO advanced session setup"
112-
depends on CIFS && KEYS
114+
depends on CIFS
113115
select DNS_RESOLVER
114116
help
115117
Enables an upcall mechanism for CIFS which accesses userspace helper
@@ -144,14 +146,6 @@ config CIFS_POSIX
144146
(such as Samba 3.10 and later) which can negotiate
145147
CIFS POSIX ACL support. If unsure, say N.
146148

147-
config CIFS_ACL
148-
bool "Provide CIFS ACL support"
149-
depends on CIFS_XATTR && KEYS
150-
help
151-
Allows fetching CIFS/NTFS ACL from the server. The DACL blob
152-
is handed over to the application/caller. See the man
153-
page for getcifsacl for more information. If unsure, say Y.
154-
155149
config CIFS_DEBUG
156150
bool "Enable CIFS debugging routines"
157151
default y
@@ -184,7 +178,7 @@ config CIFS_DEBUG_DUMP_KEYS
184178

185179
config CIFS_DFS_UPCALL
186180
bool "DFS feature support"
187-
depends on CIFS && KEYS
181+
depends on CIFS
188182
select DNS_RESOLVER
189183
help
190184
Distributed File System (DFS) support is used to access shares
@@ -203,10 +197,10 @@ config CIFS_NFSD_EXPORT
203197
Allows NFS server to export a CIFS mounted share (nfsd over cifs)
204198

205199
config CIFS_SMB_DIRECT
206-
bool "SMB Direct support (Experimental)"
200+
bool "SMB Direct support"
207201
depends on CIFS=m && INFINIBAND && INFINIBAND_ADDR_TRANS || CIFS=y && INFINIBAND=y && INFINIBAND_ADDR_TRANS=y
208202
help
209-
Enables SMB Direct experimental support for SMB 3.0, 3.02 and 3.1.1.
203+
Enables SMB Direct support for SMB 3.0, 3.02 and 3.1.1.
210204
SMB Direct allows transferring SMB packets over RDMA. If unsure,
211205
say N.
212206

fs/cifs/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,9 @@ cifs-y := trace.o cifsfs.o cifssmb.o cifs_debug.o connect.o dir.o file.o \
1010
cifs_unicode.o nterr.o cifsencrypt.o \
1111
readdir.o ioctl.o sess.o export.o smb1ops.o winucase.o \
1212
smb2ops.o smb2maperror.o smb2transport.o \
13-
smb2misc.o smb2pdu.o smb2inode.o smb2file.o
13+
smb2misc.o smb2pdu.o smb2inode.o smb2file.o cifsacl.o
1414

1515
cifs-$(CONFIG_CIFS_XATTR) += xattr.o
16-
cifs-$(CONFIG_CIFS_ACL) += cifsacl.o
1716

1817
cifs-$(CONFIG_CIFS_UPCALL) += cifs_spnego.o
1918

fs/cifs/cifs_debug.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,9 +240,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
240240
#ifdef CONFIG_CIFS_XATTR
241241
seq_printf(m, ",XATTR");
242242
#endif
243-
#ifdef CONFIG_CIFS_ACL
244243
seq_printf(m, ",ACL");
245-
#endif
246244
seq_putc(m, '\n');
247245
seq_printf(m, "CIFSMaxBufSize: %d\n", CIFSMaxBufSize);
248246
seq_printf(m, "Active VFS Requests: %d\n", GlobalTotalActiveXid);

fs/cifs/cifs_fs_sb.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
#define CIFS_MOUNT_UID_FROM_ACL 0x2000000 /* try to get UID via special SID */
5353
#define CIFS_MOUNT_NO_HANDLE_CACHE 0x4000000 /* disable caching dir handles */
5454
#define CIFS_MOUNT_NO_DFS 0x8000000 /* disable DFS resolving */
55+
#define CIFS_MOUNT_MODE_FROM_SID 0x10000000 /* retrieve mode from special ACE */
5556

5657
struct cifs_sb_info {
5758
struct rb_root tlink_tree;
@@ -83,5 +84,10 @@ struct cifs_sb_info {
8384
* failover properly.
8485
*/
8586
char *origin_fullpath; /* \\HOST\SHARE\[OPTIONAL PATH] */
87+
/*
88+
* Indicate whether serverino option was turned off later
89+
* (cifs_autodisable_serverino) in order to match new mounts.
90+
*/
91+
bool mnt_cifs_serverino_autodisabled;
8692
};
8793
#endif /* _CIFS_FS_SB_H */

fs/cifs/cifsfs.c

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,8 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
526526
seq_puts(s, ",nobrl");
527527
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_NO_HANDLE_CACHE)
528528
seq_puts(s, ",nohandlecache");
529+
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_MODE_FROM_SID)
530+
seq_puts(s, ",modefromsid");
529531
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_CIFS_ACL)
530532
seq_puts(s, ",cifsacl");
531533
if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_DYNPERM)
@@ -554,6 +556,11 @@ cifs_show_options(struct seq_file *s, struct dentry *root)
554556
seq_printf(s, ",bsize=%u", cifs_sb->bsize);
555557
seq_printf(s, ",echo_interval=%lu",
556558
tcon->ses->server->echo_interval / HZ);
559+
560+
/* Only display max_credits if it was overridden on mount */
561+
if (tcon->ses->server->max_credits != SMB2_MAX_CREDITS_AVAILABLE)
562+
seq_printf(s, ",max_credits=%u", tcon->ses->server->max_credits);
563+
557564
if (tcon->snapshot_time)
558565
seq_printf(s, ",snapshot=%llu", tcon->snapshot_time);
559566
if (tcon->handle_timeout)
@@ -1517,11 +1524,9 @@ init_cifs(void)
15171524
goto out_destroy_dfs_cache;
15181525
#endif /* CONFIG_CIFS_UPCALL */
15191526

1520-
#ifdef CONFIG_CIFS_ACL
15211527
rc = init_cifs_idmap();
15221528
if (rc)
15231529
goto out_register_key_type;
1524-
#endif /* CONFIG_CIFS_ACL */
15251530

15261531
rc = register_filesystem(&cifs_fs_type);
15271532
if (rc)
@@ -1536,10 +1541,8 @@ init_cifs(void)
15361541
return 0;
15371542

15381543
out_init_cifs_idmap:
1539-
#ifdef CONFIG_CIFS_ACL
15401544
exit_cifs_idmap();
15411545
out_register_key_type:
1542-
#endif
15431546
#ifdef CONFIG_CIFS_UPCALL
15441547
exit_cifs_spnego();
15451548
out_destroy_dfs_cache:
@@ -1571,9 +1574,7 @@ exit_cifs(void)
15711574
unregister_filesystem(&cifs_fs_type);
15721575
unregister_filesystem(&smb3_fs_type);
15731576
cifs_dfs_release_automount_timer();
1574-
#ifdef CONFIG_CIFS_ACL
15751577
exit_cifs_idmap();
1576-
#endif
15771578
#ifdef CONFIG_CIFS_UPCALL
15781579
exit_cifs_spnego();
15791580
#endif
@@ -1607,5 +1608,6 @@ MODULE_SOFTDEP("pre: sha256");
16071608
MODULE_SOFTDEP("pre: sha512");
16081609
MODULE_SOFTDEP("pre: aead2");
16091610
MODULE_SOFTDEP("pre: ccm");
1611+
MODULE_SOFTDEP("pre: gcm");
16101612
module_init(init_cifs)
16111613
module_exit(exit_cifs)

fs/cifs/cifsglob.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ struct smb_vol {
550550
bool override_gid:1;
551551
bool dynperm:1;
552552
bool noperm:1;
553+
bool mode_ace:1;
553554
bool no_psx_acl:1; /* set if posix acl support should be disabled */
554555
bool cifs_acl:1;
555556
bool backupuid_specified; /* mount option backupuid is specified */
@@ -600,6 +601,7 @@ struct smb_vol {
600601
__u64 snapshot_time; /* needed for timewarp tokens */
601602
__u32 handle_timeout; /* persistent and durable handle timeout in ms */
602603
unsigned int max_credits; /* smb3 max_credits 10 < credits < 60000 */
604+
__u16 compression; /* compression algorithm 0xFFFF default 0=disabled */
603605
};
604606

605607
/**
@@ -617,7 +619,8 @@ struct smb_vol {
617619
CIFS_MOUNT_FSCACHE | CIFS_MOUNT_MF_SYMLINKS | \
618620
CIFS_MOUNT_MULTIUSER | CIFS_MOUNT_STRICT_IO | \
619621
CIFS_MOUNT_CIFS_BACKUPUID | CIFS_MOUNT_CIFS_BACKUPGID | \
620-
CIFS_MOUNT_NO_DFS)
622+
CIFS_MOUNT_UID_FROM_ACL | CIFS_MOUNT_NO_HANDLE_CACHE | \
623+
CIFS_MOUNT_NO_DFS | CIFS_MOUNT_MODE_FROM_SID)
621624

622625
/**
623626
* Generic VFS superblock mount flags (s_flags) to consider when
@@ -1870,7 +1873,6 @@ extern unsigned int cifs_min_small; /* min size of small buf pool */
18701873
extern unsigned int cifs_max_pending; /* MAX requests at once to server*/
18711874
extern bool disable_legacy_dialects; /* forbid vers=1.0 and vers=2.0 mounts */
18721875

1873-
#ifdef CONFIG_CIFS_ACL
18741876
GLOBAL_EXTERN struct rb_root uidtree;
18751877
GLOBAL_EXTERN struct rb_root gidtree;
18761878
GLOBAL_EXTERN spinlock_t siduidlock;
@@ -1879,7 +1881,6 @@ GLOBAL_EXTERN struct rb_root siduidtree;
18791881
GLOBAL_EXTERN struct rb_root sidgidtree;
18801882
GLOBAL_EXTERN spinlock_t uidsidlock;
18811883
GLOBAL_EXTERN spinlock_t gidsidlock;
1882-
#endif /* CONFIG_CIFS_ACL */
18831884

18841885
void cifs_oplock_break(struct work_struct *work);
18851886
void cifs_queue_oplock_break(struct cifsFileInfo *cfile);

fs/cifs/cifssmb.c

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3600,11 +3600,9 @@ static int cifs_copy_posix_acl(char *trgt, char *src, const int buflen,
36003600
return size;
36013601
}
36023602

3603-
static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
3603+
static void convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
36043604
const struct posix_acl_xattr_entry *local_ace)
36053605
{
3606-
__u16 rc = 0; /* 0 = ACL converted ok */
3607-
36083606
cifs_ace->cifs_e_perm = le16_to_cpu(local_ace->e_perm);
36093607
cifs_ace->cifs_e_tag = le16_to_cpu(local_ace->e_tag);
36103608
/* BB is there a better way to handle the large uid? */
@@ -3617,7 +3615,6 @@ static __u16 convert_ace_to_cifs_ace(struct cifs_posix_ace *cifs_ace,
36173615
cifs_dbg(FYI, "perm %d tag %d id %d\n",
36183616
ace->e_perm, ace->e_tag, ace->e_id);
36193617
*/
3620-
return rc;
36213618
}
36223619

36233620
/* Convert ACL from local Linux POSIX xattr to CIFS POSIX ACL wire format */
@@ -3653,13 +3650,8 @@ static __u16 ACL_to_cifs_posix(char *parm_data, const char *pACL,
36533650
cifs_dbg(FYI, "unknown ACL type %d\n", acl_type);
36543651
return 0;
36553652
}
3656-
for (i = 0; i < count; i++) {
3657-
rc = convert_ace_to_cifs_ace(&cifs_acl->ace_array[i], &ace[i]);
3658-
if (rc != 0) {
3659-
/* ACE not converted */
3660-
break;
3661-
}
3662-
}
3653+
for (i = 0; i < count; i++)
3654+
convert_ace_to_cifs_ace(&cifs_acl->ace_array[i], &ace[i]);
36633655
if (rc == 0) {
36643656
rc = (__u16)(count * sizeof(struct cifs_posix_ace));
36653657
rc += sizeof(struct cifs_posix_acl);
@@ -3920,7 +3912,6 @@ CIFSGetExtAttr(const unsigned int xid, struct cifs_tcon *tcon,
39203912

39213913
#endif /* CONFIG_POSIX */
39223914

3923-
#ifdef CONFIG_CIFS_ACL
39243915
/*
39253916
* Initialize NT TRANSACT SMB into small smb request buffer. This assumes that
39263917
* all NT TRANSACTS that we init here have total parm and data under about 400
@@ -4164,7 +4155,6 @@ CIFSSMBSetCIFSACL(const unsigned int xid, struct cifs_tcon *tcon, __u16 fid,
41644155
return (rc);
41654156
}
41664157

4167-
#endif /* CONFIG_CIFS_ACL */
41684158

41694159
/* Legacy Query Path Information call for lookup to old servers such
41704160
as Win9x/WinME */

0 commit comments

Comments
 (0)