提交 7b136bf8 编写于 作者: S Sebastien Tisserant 提交者: Xie XiuQi

SMB3: Kernel oops mounting a encryptData share with CONFIG_DEBUG_VIRTUAL

[ Upstream commit ee9d6618 ]

Fix kernel oops when mounting a encryptData CIFS share with
CONFIG_DEBUG_VIRTUAL
Signed-off-by: NSebastien Tisserant <stisserant@wallix.com>
Reviewed-by: NPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: NSteve French <stfrench@microsoft.com>
Signed-off-by: NSasha Levin <sashal@kernel.org>
Signed-off-by: NYang Yingliang <yangyingliang@huawei.com>
上级 5ee28246
...@@ -2545,7 +2545,15 @@ fill_transform_hdr(struct smb2_transform_hdr *tr_hdr, unsigned int orig_len, ...@@ -2545,7 +2545,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, static inline void smb2_sg_set_buf(struct scatterlist *sg, const void *buf,
unsigned int buflen) 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. /* Assumes the first rqst has a transform header as the first iov.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册