mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 19:08:57 +09:00
cifs: Validate content of WSL reparse point buffers
[ Upstream commit 1f48660667efb97c3cf70485c7e1977af718b48b ] WSL socket, fifo, char and block devices have empty reparse buffer. Validate the length of the reparse buffer. Signed-off-by: Pali Rohár <pali@kernel.org> Signed-off-by: Steve French <stfrench@microsoft.com> Stable-dep-of: cad3fc0a4c8c ("cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point()") Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
6c13fcb7cf
commit
474c08712d
@@ -651,6 +651,11 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
|
||||
case IO_REPARSE_TAG_LX_FIFO:
|
||||
case IO_REPARSE_TAG_LX_CHR:
|
||||
case IO_REPARSE_TAG_LX_BLK:
|
||||
if (le16_to_cpu(buf->ReparseDataLength) != 0) {
|
||||
cifs_dbg(VFS, "srv returned malformed buffer for reparse point: 0x%08x\n",
|
||||
le32_to_cpu(buf->ReparseTag));
|
||||
return -EIO;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n",
|
||||
|
||||
Reference in New Issue
Block a user