Skip to content

Commit 1f48660

Browse files
palismfrench
authored andcommitted
cifs: Validate content of WSL reparse point buffers
WSL socket, fifo, char and block devices have empty reparse buffer. Validate the length of the reparse buffer. Signed-off-by: Pali Rohár <[email protected]> Signed-off-by: Steve French <[email protected]>
1 parent d3d797e commit 1f48660

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/smb/client/reparse.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -719,6 +719,11 @@ int parse_reparse_point(struct reparse_data_buffer *buf,
719719
case IO_REPARSE_TAG_LX_FIFO:
720720
case IO_REPARSE_TAG_LX_CHR:
721721
case IO_REPARSE_TAG_LX_BLK:
722+
if (le16_to_cpu(buf->ReparseDataLength) != 0) {
723+
cifs_dbg(VFS, "srv returned malformed buffer for reparse point: 0x%08x\n",
724+
le32_to_cpu(buf->ReparseTag));
725+
return -EIO;
726+
}
722727
break;
723728
default:
724729
cifs_tcon_dbg(VFS | ONCE, "unhandled reparse tag: 0x%08x\n",

0 commit comments

Comments
 (0)