Paulo Alcantara e5071ae7d8 smb: client: fix potential NULL deref in parse_dfs_referrals()
[ Upstream commit 92414333eb375ed64f4ae92d34d579e826936480 ]

If server returned no data for FSCTL_DFS_GET_REFERRALS, @dfs_rsp will
remain NULL and then parse_dfs_referrals() will dereference it.

Fix this by returning -EIO when no output data is returned.

Besides, we can't fix it in SMB2_ioctl() as some FSCTLs are allowed to
return no data as per MS-SMB2 2.2.32.

Fixes: 9d49640a21bf ("CIFS: implement get_dfs_refer for SMB2+")
Cc: stable@vger.kernel.org
Reported-by: Robert Morris <rtm@csail.mit.edu>
Signed-off-by: Paulo Alcantara (SUSE) <pc@manguebit.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2023-12-13 18:36:50 +01:00
..
2021-06-20 21:28:17 -05:00
2023-01-12 11:58:41 +01:00
2020-06-01 00:10:18 -05:00
2022-10-29 10:12:56 +02:00
2023-03-22 13:31:33 +01:00
2021-04-25 16:28:23 -05:00
2023-12-08 08:48:04 +01:00