Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 33bdea17 authored by Sebastien Tisserant's avatar Sebastien Tisserant Committed by Greg Kroah-Hartman
Browse files

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: default avatarSebastien Tisserant <stisserant@wallix.com>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent fab5a1fd
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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,
				   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.