Skip to content

Commit 474c087

Browse files
paligregkh
authored andcommitted
cifs: Validate content of WSL reparse point buffers
[ Upstream commit 1f48660 ] 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: cad3fc0 ("cifs: Throw -EOPNOTSUPP error on unsupported reparse point type from parse_reparse_point()") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 6c13fcb commit 474c087

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

fs/smb/client/reparse.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,11 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
651651
case IO_REPARSE_TAG_LX_FIFO:
652652
case IO_REPARSE_TAG_LX_CHR:
653653
case IO_REPARSE_TAG_LX_BLK:
654+
if (le16_to_cpu(buf->ReparseDataLength) != 0) {
655+
cifs_dbg(VFS, "srv returned malformed buffer for reparse point: 0x%08x\n",
656+
le32_to_cpu(buf->ReparseTag));
657+
return -EIO;
658+
}
654659
break;
655660
default:
656661
cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n",

0 commit comments

Comments
 (0)