cifs: fix file info setting in cifs_open_file()
authorPaulo Alcantara <pc@cjr.nz>
Fri, 6 Jan 2023 16:34:36 +0000 (13:34 -0300)
committerSteve French <stfrench@microsoft.com>
Mon, 9 Jan 2023 19:47:02 +0000 (13:47 -0600)
commitba5d4c1596cada37793d405dd18d695cd3508902
tree4f6c82237ec9b9495585581f31718c188ddab981
parent29cf28235e3e57e0af01ae29db57a75f87a2ada8
cifs: fix file info setting in cifs_open_file()

In cifs_open_file(), @buf must hold a pointer to a cifs_open_info_data
structure which is passed by cifs_nt_open(), so assigning @buf
directly to @fi was obviously wrong.

Fix this by passing a valid FILE_ALL_INFO structure to SMBLegacyOpen()
and CIFS_open(), and then copy the set structure to the corresponding
cifs_open_info_data::fi field with move_cifs_info_to_smb2() helper.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=216889
Fixes: 76894f3e2f71 ("cifs: improve symlink handling for smb2+")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb1ops.c