summaryrefslogtreecommitdiffstats
path: root/fs/cifs
diff options
context:
space:
mode:
authorSebastien Tisserant <stisserant@wallix.com>2019-08-01 12:06:08 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-29 08:30:14 +0200
commit4fe7ee5ed9b045c2c8e54bac39daba265aa288e0 (patch)
tree98b80979f2e6e05ccb3caf340008926f41f6e7cc /fs/cifs
parentefb86f76c6c846d20ebfa0b4c6c44bf8d0ce95b4 (diff)
downloadlinux-stable-4fe7ee5ed9b045c2c8e54bac39daba265aa288e0.tar.gz
linux-stable-4fe7ee5ed9b045c2c8e54bac39daba265aa288e0.tar.bz2
linux-stable-4fe7ee5ed9b045c2c8e54bac39daba265aa288e0.zip
SMB3: Kernel oops mounting a encryptData share with CONFIG_DEBUG_VIRTUAL
[ Upstream commit ee9d66182392695535cc9fccfcb40c16f72de2a9 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
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 ae10d6e297c3..42de31d20616 100644
--- a/fs/cifs/smb2ops.c
+++ b/fs/cifs/smb2ops.c
@@ -3439,7 +3439,15 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len,
static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,
unsigned int buflen)
{
- sg_set_page(sg, virt_to_page(buf), buflen, offset_in_page(buf));
+ void *addr;
+ /*
+ * VMAP_STACK (at least) puts stack into the vmalloc address space
+ */
+ if (is_vmalloc_addr(buf))
+ addr = vmalloc_to_page(buf);
+ else
+ addr = virt_to_page(buf);
+ sg_set_page(sg, addr, buflen, offset_in_page(buf));
}
/* Assumes the first rqst has a transform header as the first iov.