diff mbox

[SMB3] Fix oops when creating symlinks on smb3

Message ID CAH2r5mv_aH=RCOVW+n6T=zZuXtCNaDNM2QZJUyQJyjf6_KcEYg@mail.gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve French Sept. 15, 2014, 4:43 p.m. UTC
When the protocol ops for create mf symlink was added
we were not checking for symlink support properly for SMB2/SMB3
mounts so could oops when mounted with mfsymlinks when try
to create symlink when on smb2/smb3 mounts rather than cifs
mount

I will add a followon patch for mfsymlinks for SMB3 but in the
meantime need to avoid this possible oops.

Signed-off-by: Steve French <smfrench@gmail.com>
Cc: <stable@vger.kernel.org> # 3.14+
CC: Sachin Prabhu <sprabhu@redhat.com>
---
 fs/cifs/link.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

Comments

Sachin Prabhu Sept. 18, 2014, 1:33 p.m. UTC | #1
On Mon, 2014-09-15 at 11:43 -0500, Steve French wrote:
> When the protocol ops for create mf symlink was added
> we were not checking for symlink support properly for SMB2/SMB3
> mounts so could oops when mounted with mfsymlinks when try
> to create symlink when on smb2/smb3 mounts rather than cifs
> mount
> 
> I will add a followon patch for mfsymlinks for SMB3 but in the
> meantime need to avoid this possible oops.
> 
> Signed-off-by: Steve French <smfrench@gmail.com>
> Cc: <stable@vger.kernel.org> # 3.14+
> CC: Sachin Prabhu <sprabhu@redhat.com>
> ---
>  fs/cifs/link.c | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/cifs/link.c b/fs/cifs/link.c
> index 68559fd..a5c2812 100644
> --- a/fs/cifs/link.c
> +++ b/fs/cifs/link.c
> @@ -213,8 +213,12 @@ create_mf_symlink(const unsigned int xid, struct
> cifs_tcon *tcon,
>      if (rc)
>          goto out;
> 
> -    rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
> -                    fromName, buf, &bytes_written);
> +    if (tcon->ses->server->ops->create_mf_symlink)
> +        rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
> +                    cifs_sb, fromName, buf, &bytes_written);
> +    else
> +        rc = -EOPNOTSUPP;
> +
>      if (rc)
>          goto out;
> 
> 
ACK-ed by: Sachin Prabhu <sprabhu@redhat.com>


--
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
diff mbox

Patch

diff --git a/fs/cifs/link.c b/fs/cifs/link.c
index 68559fd..a5c2812 100644
--- a/fs/cifs/link.c
+++ b/fs/cifs/link.c
@@ -213,8 +213,12 @@  create_mf_symlink(const unsigned int xid, struct
cifs_tcon *tcon,
     if (rc)
         goto out;

-    rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon, cifs_sb,
-                    fromName, buf, &bytes_written);
+    if (tcon->ses->server->ops->create_mf_symlink)
+        rc = tcon->ses->server->ops->create_mf_symlink(xid, tcon,
+                    cifs_sb, fromName, buf, &bytes_written);
+    else
+        rc = -EOPNOTSUPP;
+
     if (rc)
         goto out;