diff options
author | 2024-09-21 01:29:33 +0200 | |
---|---|---|
committer | 2024-11-25 14:50:32 -0600 | |
commit | 1f48660667efb97c3cf70485c7e1977af718b48b (patch) | |
tree | 3e648ffafcb4270582e74bb16eb858c9383ab160 | |
parent | cifs: Improve guard for excluding $LXDEV xattr (diff) | |
download | wireguard-linux-1f48660667efb97c3cf70485c7e1977af718b48b.tar.xz wireguard-linux-1f48660667efb97c3cf70485c7e1977af718b48b.zip |
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 <pali@kernel.org>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to '')
-rw-r--r-- | fs/smb/client/reparse.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/smb/client/reparse.c b/fs/smb/client/reparse.c index 732b3b51128b..e81d2d78ddb7 100644 --- a/fs/smb/client/reparse.c +++ b/fs/smb/client/reparse.c @@ -719,6 +719,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", |