All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] Various fixes for multiuser SMB mounts
@ 2020-06-26 19:58 Paul Aurich
  2020-06-26 19:58 ` [PATCH 1/6] cifs: Display local UID details for SMB sessions in DebugData Paul Aurich
                   ` (6 more replies)
  0 siblings, 7 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

Ensure several mount parameters work properly on multiuser mounts for non-root
users, and add the user ID / credentials user ID to the session output in
DebugData.

Note that the 'posix' fix is speculative, as I don't currently have a server
instance that supports SMB2 posix extensions.

Regards,
~Paul



^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH 1/6] cifs: Display local UID details for SMB sessions in DebugData
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-26 19:58 ` [PATCH 2/6] SMB3: Honor 'seal' flag for multiuser mounts Paul Aurich
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

This is useful for distinguishing SMB sessions on a multiuser mount.

Signed-off-by: Paul Aurich <paul@darkrain42.org>
---
 fs/cifs/cifs_debug.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index fc98b97b396a..53588d7517b4 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -399,6 +399,10 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 			if (ses->sign)
 				seq_puts(m, " signed");
 
+			seq_printf(m, "\n\tUser: %d Cred User: %d",
+				   from_kuid(&init_user_ns, ses->linux_uid),
+				   from_kuid(&init_user_ns, ses->cred_uid));
+
 			if (ses->chan_count > 1) {
 				seq_printf(m, "\n\n\tExtra Channels: %zu\n",
 					   ses->chan_count-1);
@@ -406,7 +410,7 @@ static int cifs_debug_data_proc_show(struct seq_file *m, void *v)
 					cifs_dump_channel(m, j, &ses->chans[j]);
 			}
 
-			seq_puts(m, "\n\tShares:");
+			seq_puts(m, "\n\n\tShares:");
 			j = 0;
 
 			seq_printf(m, "\n\t%d) IPC: ", j);
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 2/6] SMB3: Honor 'seal' flag for multiuser mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
  2020-06-26 19:58 ` [PATCH 1/6] cifs: Display local UID details for SMB sessions in DebugData Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-26 19:58 ` [PATCH 3/6] SMB3: Honor persistent/resilient handle flags " Paul Aurich
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

Ensure multiuser SMB3 mounts use encryption for all users' tcons if the
mount options are configured to require encryption. Without this, only
the primary tcon and IPC tcons are guaranteed to be encrypted. Per-user
tcons would only be encrypted if the server was configured to require
encryption.

Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org>
---
 fs/cifs/connect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 5fac34f192af..804509f7f3a1 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -5309,6 +5309,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 	vol_info->no_linux_ext = !master_tcon->unix_ext;
 	vol_info->sectype = master_tcon->ses->sectype;
 	vol_info->sign = master_tcon->ses->sign;
+	vol_info->seal = master_tcon->seal;
 
 	rc = cifs_set_vol_auth(vol_info, master_tcon->ses);
 	if (rc) {
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 3/6] SMB3: Honor persistent/resilient handle flags for multiuser mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
  2020-06-26 19:58 ` [PATCH 1/6] cifs: Display local UID details for SMB sessions in DebugData Paul Aurich
  2020-06-26 19:58 ` [PATCH 2/6] SMB3: Honor 'seal' flag for multiuser mounts Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-26 19:58 ` [PATCH 4/6] SMB3: Honor lease disabling " Paul Aurich
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

Without this:

- persistent handles will only be enabled for per-user tcons if the
  server advertises the 'Continuous Availabity' capability
- resilient handles would never be enabled for per-user tcons

Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org>
---
 fs/cifs/connect.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 804509f7f3a1..dc7f875d2caf 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -5306,6 +5306,8 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 	vol_info->nocase = master_tcon->nocase;
 	vol_info->nohandlecache = master_tcon->nohandlecache;
 	vol_info->local_lease = master_tcon->local_lease;
+	vol_info->resilient = master_tcon->use_resilient;
+	vol_info->persistent = master_tcon->use_persistent;
 	vol_info->no_linux_ext = !master_tcon->unix_ext;
 	vol_info->sectype = master_tcon->ses->sectype;
 	vol_info->sign = master_tcon->ses->sign;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 4/6] SMB3: Honor lease disabling for multiuser mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
                   ` (2 preceding siblings ...)
  2020-06-26 19:58 ` [PATCH 3/6] SMB3: Honor persistent/resilient handle flags " Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-26 19:58 ` [PATCH 5/6] SMB3: Honor 'handletimeout' flag " Paul Aurich
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

Fixes: 3e7a02d47872 ("smb3: allow disabling requesting leases")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org>
---
 fs/cifs/connect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index dc7f875d2caf..6e71a1578e34 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -5306,6 +5306,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 	vol_info->nocase = master_tcon->nocase;
 	vol_info->nohandlecache = master_tcon->nohandlecache;
 	vol_info->local_lease = master_tcon->local_lease;
+	vol_info->no_lease = master_tcon->no_lease;
 	vol_info->resilient = master_tcon->use_resilient;
 	vol_info->persistent = master_tcon->use_persistent;
 	vol_info->no_linux_ext = !master_tcon->unix_ext;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 5/6] SMB3: Honor 'handletimeout' flag for multiuser mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
                   ` (3 preceding siblings ...)
  2020-06-26 19:58 ` [PATCH 4/6] SMB3: Honor lease disabling " Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-26 19:58 ` [PATCH 6/6] SMB3: Honor 'posix' " Paul Aurich
  2020-06-29  1:44 ` [PATCH 0/6] Various fixes for multiuser SMB mounts Steve French
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

Fixes: ca567eb2b3f0 ("SMB3: Allow persistent handle timeout to be configurable on mount")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
CC: Stable <stable@vger.kernel.org>
---
 fs/cifs/connect.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index 6e71a1578e34..dada6d51e034 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -5309,6 +5309,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 	vol_info->no_lease = master_tcon->no_lease;
 	vol_info->resilient = master_tcon->use_resilient;
 	vol_info->persistent = master_tcon->use_persistent;
+	vol_info->handle_timeout = master_tcon->handle_timeout;
 	vol_info->no_linux_ext = !master_tcon->unix_ext;
 	vol_info->sectype = master_tcon->ses->sectype;
 	vol_info->sign = master_tcon->ses->sign;
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH 6/6] SMB3: Honor 'posix' flag for multiuser mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
                   ` (4 preceding siblings ...)
  2020-06-26 19:58 ` [PATCH 5/6] SMB3: Honor 'handletimeout' flag " Paul Aurich
@ 2020-06-26 19:58 ` Paul Aurich
  2020-06-29  1:44 ` [PATCH 0/6] Various fixes for multiuser SMB mounts Steve French
  6 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-26 19:58 UTC (permalink / raw)
  To: linux-cifs, sfrench; +Cc: paul

The flag from the primary tcon needs to be copied into the volume info
so that cifs_get_tcon will try to enable extensions on the per-user
tcon. At that point, since posix extensions must have already been
enabled on the superblock, don't try to needlessly adjust the mount
flags.

Fixes: ce558b0e17f8 ("smb3: Add posix create context for smb3.11 posix mounts")
Fixes: b326614ea215 ("smb3: allow "posix" mount option to enable new SMB311 protocol extensions")
Signed-off-by: Paul Aurich <paul@darkrain42.org>
---
 fs/cifs/connect.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index dada6d51e034..a61abde09ffe 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -5311,6 +5311,7 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 	vol_info->persistent = master_tcon->use_persistent;
 	vol_info->handle_timeout = master_tcon->handle_timeout;
 	vol_info->no_linux_ext = !master_tcon->unix_ext;
+	vol_info->linux_ext = master_tcon->posix_extensions;
 	vol_info->sectype = master_tcon->ses->sectype;
 	vol_info->sign = master_tcon->ses->sign;
 	vol_info->seal = master_tcon->seal;
@@ -5339,10 +5340,6 @@ cifs_construct_tcon(struct cifs_sb_info *cifs_sb, kuid_t fsuid)
 		goto out;
 	}
 
-	/* if new SMB3.11 POSIX extensions are supported do not remap / and \ */
-	if (tcon->posix_extensions)
-		cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_POSIX_PATHS;
-
 	if (cap_unix(ses))
 		reset_cifs_unix_caps(0, tcon, NULL, vol_info);
 
-- 
2.27.0


^ permalink raw reply related	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] Various fixes for multiuser SMB mounts
  2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
                   ` (5 preceding siblings ...)
  2020-06-26 19:58 ` [PATCH 6/6] SMB3: Honor 'posix' " Paul Aurich
@ 2020-06-29  1:44 ` Steve French
  2020-06-29  9:39   ` Aurélien Aptel
  6 siblings, 1 reply; 10+ messages in thread
From: Steve French @ 2020-06-29  1:44 UTC (permalink / raw)
  To: Paul Aurich; +Cc: CIFS

these and the two others (one from one) recently posted tentatively
merged into cifs-2.6.git for-next pending review and testing

http://smb3-test-rhel-75.southcentralus.cloudapp.azure.com/#/builders/5/builds/73

On Fri, Jun 26, 2020 at 3:07 PM Paul Aurich <paul@darkrain42.org> wrote:
>
> Ensure several mount parameters work properly on multiuser mounts for non-root
> users, and add the user ID / credentials user ID to the session output in
> DebugData.
>
> Note that the 'posix' fix is speculative, as I don't currently have a server
> instance that supports SMB2 posix extensions.
>
> Regards,
> ~Paul
>
>


-- 
Thanks,

Steve

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] Various fixes for multiuser SMB mounts
  2020-06-29  1:44 ` [PATCH 0/6] Various fixes for multiuser SMB mounts Steve French
@ 2020-06-29  9:39   ` Aurélien Aptel
  2020-06-30  2:43     ` Paul Aurich
  0 siblings, 1 reply; 10+ messages in thread
From: Aurélien Aptel @ 2020-06-29  9:39 UTC (permalink / raw)
  To: Steve French, Paul Aurich; +Cc: CIFS

Thanks Paul!

All changes looks good to me and I think could be squashed into 1
commit: they are all adjusting the volume info used to mount from the master
tcon, all in the same func.

Reviewed-by: Aurelien Aptel <aaptel@suse.com>

Steve French <smfrench@gmail.com> writes:
> these and the two others (one from one) recently posted tentatively
> merged into cifs-2.6.git for-next pending review and testing

I don't think we have any multiuser tests, sadly :(

Cheers,
-- 
Aurélien Aptel / SUSE Labs Samba Team
GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH 0/6] Various fixes for multiuser SMB mounts
  2020-06-29  9:39   ` Aurélien Aptel
@ 2020-06-30  2:43     ` Paul Aurich
  0 siblings, 0 replies; 10+ messages in thread
From: Paul Aurich @ 2020-06-30  2:43 UTC (permalink / raw)
  To: Aurélien Aptel; +Cc: Steve French, CIFS

On 2020-06-29 11:39:02 +0200, Aurélien Aptel wrote:
>Thanks Paul!
>
>All changes looks good to me and I think could be squashed into 1
>commit: they are all adjusting the volume info used to mount from the master
>tcon, all in the same func.

I kept them separate just because they may have different applicability to 
stable branches. As I wrote that, though, I realized I didn't test/check if 
they'd apply or not (because of ordering).

I don't mind if they're squashed.  (I can do that and resend if needed.)

>Reviewed-by: Aurelien Aptel <aaptel@suse.com>
>
>Steve French <smfrench@gmail.com> writes:
>> these and the two others (one from one) recently posted tentatively
>> merged into cifs-2.6.git for-next pending review and testing
>
>I don't think we have any multiuser tests, sadly :(
>
>Cheers,
>-- 
>Aurélien Aptel / SUSE Labs Samba Team
>GPG: 1839 CB5F 9F5B FB9B AA97  8C99 03C8 A49B 521B D5D3
>SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg, DE
>GF: Felix Imendörffer, Mary Higgins, Sri Rasiah HRB 247165 (AG München)
>

~Paul


^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2020-06-30  2:43 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-26 19:58 [PATCH 0/6] Various fixes for multiuser SMB mounts Paul Aurich
2020-06-26 19:58 ` [PATCH 1/6] cifs: Display local UID details for SMB sessions in DebugData Paul Aurich
2020-06-26 19:58 ` [PATCH 2/6] SMB3: Honor 'seal' flag for multiuser mounts Paul Aurich
2020-06-26 19:58 ` [PATCH 3/6] SMB3: Honor persistent/resilient handle flags " Paul Aurich
2020-06-26 19:58 ` [PATCH 4/6] SMB3: Honor lease disabling " Paul Aurich
2020-06-26 19:58 ` [PATCH 5/6] SMB3: Honor 'handletimeout' flag " Paul Aurich
2020-06-26 19:58 ` [PATCH 6/6] SMB3: Honor 'posix' " Paul Aurich
2020-06-29  1:44 ` [PATCH 0/6] Various fixes for multiuser SMB mounts Steve French
2020-06-29  9:39   ` Aurélien Aptel
2020-06-30  2:43     ` Paul Aurich

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.