Discussion:
[PATCH 5/6] cifs: smbd: Enable signing with smbdirect
Steve French via samba-technical
2018-04-17 03:31:59 UTC
Permalink
Thoughts on cc:stable?
Now signing is supported with RDMA transport.
Remove the code that disabled it.
---
fs/cifs/connect.c | 8 --------
fs/cifs/smb2pdu.c | 4 ----
2 files changed, 12 deletions(-)
diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e8830f0..deef270 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1977,14 +1977,6 @@ cifs_parse_mount_options(const char *mountdata,
const char *devname,
goto cifs_parse_mount_err;
}
-#ifdef CONFIG_CIFS_SMB_DIRECT
- if (vol->rdma && vol->sign) {
- cifs_dbg(VFS, "Currently SMB direct doesn't support
signing."
- " This is being fixed\n");
- goto cifs_parse_mount_err;
- }
-#endif
-
#ifndef CONFIG_KEYS
/* Muliuser mounts require CONFIG_KEYS support */
if (vol->multiuser) {
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6759035..d71ce51 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -737,10 +737,6 @@ int smb3_validate_negotiate(const unsigned int xid,
struct cifs_tcon *tcon)
cifs_dbg(FYI, "validate negotiate\n");
-#ifdef CONFIG_CIFS_SMB_DIRECT
- if (tcon->ses->server->rdma)
- return 0;
-#endif
pneg_inbuf = kmalloc(sizeof(*pneg_inbuf), GFP_KERNEL);
if (!pneg_inbuf)
return -ENOMEM;
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
More majordomo info at http://vger.kernel.org/majordomo-info.html
Long Li via samba-technical
2018-04-17 17:55:00 UTC
Permalink
Subject: Re: [PATCH 1/6] cifs: smbd: Check for iov length on sending the last
iov
When sending the last iov that breaks into smaller buffers to fit the
transfer size, it's necessary to check if this is the last iov.
If this is the latest iov, stop and proceed to send pages.
---
fs/cifs/smbdirect.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/fs/cifs/smbdirect.c b/fs/cifs/smbdirect.c index
90e673c..b5c6c0d 100644
--- a/fs/cifs/smbdirect.c
+++ b/fs/cifs/smbdirect.c
@@ -2197,6 +2197,8 @@ int smbd_send(struct smbd_connection *info,
struct smb_rqst *rqst)
goto done;
}
i++;
+ if (i == rqst->rq_nvec)
+ break;
}
start = i;
buflen = 0;
--
2.7.4
<formletter>
This is not the correct way to submit patches for inclusion in the stable kernel
https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.
kernel.org%2Fdoc%2Fhtml%2Flatest%2Fprocess%2Fstable-kernel-
rules.html&data=02%7C01%7Clongli%40microsoft.com%7Cec2fc0284244483b
25bf08d5a434f6dc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636
595469807590402&sdata=YXqnaTFgRyUyN1ubhCcyblT2ni%2F%2BCowPYJSFje
6PuCk%3D&reserved=0
for how to do this properly.
</formletter>
Will do. Thank you.
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.ke
rnel.org%2Fmajordomo-
info.html&data=02%7C01%7Clongli%40microsoft.com%7Cec2fc0284244483b2
5bf08d5a434f6dc%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C6365
95469807590402&sdata=uu9VQ%2BHscmeFJH6kQEf39G2a7Y8M9hMmvBI2s9
T1DXs%3D&reserved=0
Long Li via samba-technical
2018-04-17 18:11:42 UTC
Permalink
Subject: RE: [PATCH 2/6] cifs: Allocate validate negoation request through
kmalloc
-----Original Message-----
Sent: Monday, April 16, 2018 7:49 PM
Subject: [PATCH 2/6] cifs: Allocate validate negoation request through
kmalloc
The data buffer allocated on the stack can't be DMA'ed, and hence
can't send through RDMA via SMB Direct.
Fix this by allocating the request on the heap in smb3_validate_negotiate.
Please provide Fixes ("12-letters commit id") "commit string" which
introduced this issue and it is getting fixed here, so that other can apply this
fix to older versions.
Will do.
---
fs/cifs/smb2pdu.c | 38 ++++++++++++++++++++++----------------
1 file changed, 22 insertions(+), 16 deletions(-)
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index
0f044c4..abbefe2
100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -730,7 +730,7 @@ SMB2_negotiate(const unsigned int xid, struct
cifs_ses
*ses) int smb3_validate_negotiate(const unsigned int xid, struct
cifs_tcon
*tcon) {
int rc = 0;
- struct validate_negotiate_info_req vneg_inbuf;
+ struct validate_negotiate_info_req *pneg_inbuf;
[..]
rc = SMB2_ioctl(xid, tcon, NO_FILE_ID, NO_FILE_ID,
FSCTL_VALIDATE_NEGOTIATE_INFO, true /* is_fsctl */,
- (char *)&vneg_inbuf, sizeof(struct
validate_negotiate_info_req),
+ (char *)pneg_inbuf, sizeof(struct
validate_negotiate_info_req),
(char **)&pneg_rsp, &rsplen);
if (rc != 0) {
cifs_dbg(VFS, "validate protocol negotiate failed: %d\n", rc);
+ kfree(pneg_inbuf);
return -EIO;
Instead of duplicating code here, please jump to err_rsp_free label. Kfree()
takes care to not panic for NULL pointer.
Or for clarity define new label.
I will fix this.
}
@@ -838,12 +842,14 @@ int smb3_validate_negotiate(const unsigned int
xid, struct cifs_tcon *tcon)
/* validate negotiate successful */
cifs_dbg(FYI, "validate negotiate info successful\n");
+ kfree(pneg_inbuf);
kfree(pneg_rsp);
return 0;
cifs_dbg(VFS, "protocol revalidation - security settings
mismatch\n");
+ kfree(pneg_inbuf);
kfree(pneg_rsp);
return -EIO;
}
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma"
majordomo
info at
https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.k
ernel.org%2Fmajordomo-
info.html&data=02%7C01%7Clongli%40microsoft.com%
7Cc8c0b791819745b7403408d5a417d9d2%7C72f988bf86f141af91ab2d7cd011d
b47%
7C1%7C0%7C636595344704783010&sdata=99vU6g%2FE5b8TG8Dn2MngmNw
pP5MghgdoV
hBf0sak%2B0w%3D&reserved=0
Long Li via samba-technical
2018-04-17 18:57:12 UTC
Permalink
It’s a good idea to cc:stable.

From: Steve French <***@gmail.com>
Sent: Monday, April 16, 2018 8:32 PM
To: Long Li <***@microsoft.com>
Cc: Steve French <***@samba.org>; CIFS <linux-***@vger.kernel.org>; samba-***@lists.samba.org; linux-***@vger.kernel.org; linux-***@vger.kernel.org; ***@vger.kernel.org
Subject: Re: [PATCH 5/6] cifs: smbd: Enable signing with smbdirect

Thoughts on cc:stable?

On Mon, Apr 16, 2018, 20:02 Long Li <***@linuxonhyperv.com<mailto:***@linuxonhyperv.com>> wrote:
From: Long Li <***@microsoft.com<mailto:***@microsoft.com>>

Now signing is supported with RDMA transport.

Remove the code that disabled it.

Signed-off-by: Long Li <***@microsoft.com<mailto:***@microsoft.com>>
---
fs/cifs/connect.c | 8 --------
fs/cifs/smb2pdu.c | 4 ----
2 files changed, 12 deletions(-)

diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c
index e8830f0..deef270 100644
--- a/fs/cifs/connect.c
+++ b/fs/cifs/connect.c
@@ -1977,14 +1977,6 @@ cifs_parse_mount_options(const char *mountdata, const char *devname,
goto cifs_parse_mount_err;
}

-#ifdef CONFIG_CIFS_SMB_DIRECT
- if (vol->rdma && vol->sign) {
- cifs_dbg(VFS, "Currently SMB direct doesn't support signing."
- " This is being fixed\n");
- goto cifs_parse_mount_err;
- }
-#endif
-
#ifndef CONFIG_KEYS
/* Muliuser mounts require CONFIG_KEYS support */
if (vol->multiuser) {
diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c
index 6759035..d71ce51 100644
--- a/fs/cifs/smb2pdu.c
+++ b/fs/cifs/smb2pdu.c
@@ -737,10 +737,6 @@ int smb3_validate_negotiate(const unsigned int xid, struct cifs_tcon *tcon)

cifs_dbg(FYI, "validate negotiate\n");

-#ifdef CONFIG_CIFS_SMB_DIRECT
- if (tcon->ses->server->rdma)
- return 0;
-#endif
pneg_inbuf = kmalloc(sizeof(*pneg_inbuf), GFP_KERNEL);
if (!pneg_inbuf)
return -ENOMEM;
--
2.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to ***@vger.kernel.org<mailto:***@vger.kernel.org>
More majordomo info at http://vger.kernel.org/majordomo-info.html<https://na01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fvger.kernel.org%2Fmajordomo-info.html&data=02%7C01%7Clongli%40microsoft.com%7C299ea1f40e9343bf280c08d5a413cdf2%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636595327334161489&sdata=PPNXoJ9vzj1Zoh%2B8SN6hqd3t
Loading...