[v1,3/6] fs/cifs: always use ipc for DFS resolving ioctls
diff mbox

Message ID 1478622806-19636-4-git-send-email-aaptel@suse.com
State New
Headers show

Commit Message

Aurelien Aptel Nov. 8, 2016, 4:33 p.m. UTC
since we cannot access the ipc tcon object, force the use of the ipc tid
when crafting DFS resolving ioctl.

Signed-off-by: Aurelien Aptel <aaptel@suse.com>
---
 fs/cifs/smb2pdu.c | 4 ++++
 1 file changed, 4 insertions(+)

Comments

Pavel Shilovsky Nov. 11, 2016, 12:46 a.m. UTC | #1
2016-11-08 8:33 GMT-08:00 Aurelien Aptel <aaptel@suse.com>:
> since we cannot access the ipc tcon object, force the use of the ipc tid
> when crafting DFS resolving ioctl.
>
> Signed-off-by: Aurelien Aptel <aaptel@suse.com>
> ---
>  fs/cifs/smb2pdu.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
> index 5ca5ea46..6d5b8db 100644
> --- a/fs/cifs/smb2pdu.c
> +++ b/fs/cifs/smb2pdu.c
> @@ -1645,6 +1645,10 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
>         if (rc)
>                 return rc;
>
> +       /* XXX: how can we access the tcon of the IPC of the host? */
> +       if (opcode == FSCTL_DFS_GET_REFERRALS) {
> +               req->hdr.TreeId = ses->ipc_tid;
> +       }

It seems like spec (3.2.4.20.3) says that we can use any existing ses
and tcon for the current user. See my comment to the previous patch.

>         req->CtlCode = cpu_to_le32(opcode);
>         req->PersistentFileId = persistent_fid;
>         req->VolatileFileId = volatile_fid;
> --
> 2.1.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch
diff mbox

diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 5ca5ea46..6d5b8db 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -1645,6 +1645,10 @@  SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
 	if (rc)
 		return rc;
 
+	/* XXX: how can we access the tcon of the IPC of the host? */
+	if (opcode == FSCTL_DFS_GET_REFERRALS) {
+		req->hdr.TreeId = ses->ipc_tid;
+	}
 	req->CtlCode = cpu_to_le32(opcode);
 	req->PersistentFileId = persistent_fid;
 	req->VolatileFileId = volatile_fid;