cifs: fix use after free for iface while disabling secondary channels
Subsystems (2)
PATCH 1/1 cifs: fix use after free for iface while disabling secondary channels
We were deferencing iface after it has been released. Fix is to release after all dereference instances have been encountered.
Signed-off-by Ritvik Budhiraja <[email protected]>
Reported-by kernel test robot <[email protected]>
Reported-by Dan Carpenter <[email protected]>
--- fs/smb/client/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/smb/client/sess.c +1 -1
@@ -332,10 +332,10 @@ cifs_disable_secondary_channels(struct cifs_ses *ses)if (iface) {spin_lock (&ses->iface_lock); -kref_put (&iface->refcount, release_iface); iface->num_channels--;if (iface->weight_fulfilled) iface->weight_fulfilled--; +kref_put (&iface->refcount, release_iface);spin_unlock (&ses->iface_lock); }
Signature · 1 line
2.34.1
tentatively merged into for-next pending testing
Quoted 31 lines · Ritvik Budhiraja
We were deferencing iface after it has been released. Fix is to release after all dereference instances have been encountered.
Signed-off-by Ritvik Budhiraja <[email protected]>Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>--- fs/smb/client/sess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)fs/smb/client/sess.c +1
-2@@ -332,10 +332,10 @@ cifs_disable_secondary_channels(struct cifs_ses *ses)if (iface) {spin_lock (&ses->iface_lock); -kref_put (&iface->refcount, release_iface); iface->num_channels--;if (iface->weight_fulfilled) iface->weight_fulfilled--; +kref_put (&iface->refcount, release_iface);spin_unlock (&ses->iface_lock); } --2.34.1
Signature · 3 lines
Thanks, Steve