]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:58:14 +0000 (11:58 +0100)
commit140331248f1d660eddba37a0ea16ec88480a9d4c
tree29ce19febb7ecebda730353bc80d3a1140b5f39e
parent99324bfe2eba1ceac91af5922e95b85019dfa069
cifs: fix file info setting in cifs_open_file()

commit f8772417823ec29a32232addb104d79ca7e42bdb upstream.

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: 2f42339dd042 ("cifs: improve symlink handling for smb2+")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/cifs/smb1ops.c