aboutsummaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSebastien Tisserant <stisserant@wallix.com>2019-08-01 13:06:08 -0400
committerSteve French <stfrench@microsoft.com>2019-08-05 23:50:38 -0400
commitee9d66182392695535cc9fccfcb40c16f72de2a9 (patch)
treed350eb332727522f430901b46d8e4d3cf32d51a8 /fs/cifs
parent108624eaff6f17f1966e4a94dc7bc5df2c5115ee (diff)
SMB3: Kernel oops mounting a encryptData share with CONFIG_DEBUG_VIRTUAL
Fix kernel oops when mounting a encryptData CIFS share with CONFIG_DEBUG_VIRTUAL Signed-off-by: Sebastien Tisserant <stisserant@wallix.com> Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com> Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r--fs/cifs/smb2ops.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c
index 19589922ef2b..64a5864127be 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3489,7 +3489,15 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len,
3489static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf, 3489static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,
3490 unsigned int buflen) 3490 unsigned int buflen)
3491{ 3491{
3492 sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf)); 3492 void *addr;
3493 /*
3494 * VMAP_STACK (at least) puts stack into the vmalloc address space
3495 */
3496 if (is_vmalloc_addr(buf))
3497 addr = vmalloc_to_page(buf);
3498 else
3499 addr = virt_to_page(buf);
3500 sg_set_page(sg, addr, buflen, offset_in_page(buf));
3493} 3501}
3494 3502
3495/* Assumes the first rqst has a transform header as the first iov. 3503/* Assumes the first rqst has a transform header as the first iov.