]> git.baikalelectronics.ru Git - kernel.git/commit
cifs: fix potential use-after-free bugs
authorPaulo Alcantara <pc@cjr.nz>
Fri, 12 Nov 2021 18:16:08 +0000 (15:16 -0300)
committerSteve French <stfrench@microsoft.com>
Fri, 12 Nov 2021 18:59:59 +0000 (12:59 -0600)
commit0be9d889ca34262685ddcfc666c5a67a84d845d4
tree58dc163d9de07ac2cb55e5ca2c7928c7daf215a9
parentf9bd59f6d51a0dcedaa0939d3244fdfcc78b298c
cifs: fix potential use-after-free bugs

Ensure that share and prefix variables are set to NULL after kfree()
when looping through DFS targets in __tree_connect_dfs_target().

Also, get rid of @ref in __tree_connect_dfs_target() and just pass a
boolean to indicate whether we're handling link targets or not.

Fixes: 631f7087f623 ("cifs: support nested dfs links over reconnect")
Signed-off-by: Paulo Alcantara (SUSE) <pc@cjr.nz>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/connect.c