Paulo Alcantara pc@cjr.nz writes:
Unfortunately we can't kfree() the UNC and prefix paths in cifs_smb3_do_mount() because they could have come from a chased DFS referral (automount) and we rely on the new values set in cifs_sb->ctx prior to calling cifs_mount().
Instead, fix smb3_parse_devname() to not leak the UNC and prefix paths when parsing new share paths.
Cc: stable@vger.kernel.org # v5.11+ Fixes: 315db9a05b7a ("cifs: fix leak in cifs_smb3_do_mount() ctx") Signed-off-by: Paulo Alcantara (SUSE) pc@cjr.nz
fs/cifs/cifsfs.c | 6 ------ fs/cifs/connect.c | 10 +++++++--- fs/cifs/fs_context.c | 2 ++ 3 files changed, 9 insertions(+), 9 deletions(-)
Please ignore this patch. The commit msg is also misleading.
I'll post another one soon.