cifs: Use after free in debug code
Subsystems (3)
PATCH 1/1 cifs: Use after free in debug code
This debug code dereferences "old_iface" after it was already freed by the call to release_iface(). Re-order the debugging to avoid this issue.
Fixes b54034a73baf ("cifs: during reconnect, update interface if necessary")
Signed-off-by Dan Carpenter <[email protected]>
--- fs/cifs/sess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/cifs/sess.c +2 -2
@@ -302,14 +302,14 @@ cifs_chan_update_iface(struct cifs_ses *ses, struct TCP_Server_Info *server)/* now drop the ref to the current iface */ if (old_iface && iface) { -kref_put (&old_iface->refcount, release_iface);cifs_dbg (FYI ,"replacing iface: %pIS with %pIS\n" , &old_iface->sockaddr, &iface->sockaddr); - }else if (old_iface) {kref_put (&old_iface->refcount, release_iface); + }else if (old_iface) {cifs_dbg (FYI ,"releasing ref to iface: %pIS\n" , &old_iface->sockaddr); +kref_put (&old_iface->refcount, release_iface); }else {WARN_ON (!iface);cifs_dbg (FYI ,"adding new iface: %pIS\n" , &iface->sockaddr);
Signature · 1 line
2.35.1
Quoted 9 lines · Dan Carpenter
This debug code dereferences "
old_iface" after it was already freed by the call torelease_iface(). Re-order the debugging to avoid this issue.Fixes b54034a73baf ("cifs: during reconnect, update interface if necessary")Signed-off-by Dan Carpenter <[email protected]>--- fs/cifs/sess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Reviewed-by Paulo Alcantara (SUSE) <[email protected]>
Steve French
Appliedmerged into cifs-2.6.git for-next
Quoted 15 lines · Paulo Alcantara via samba-technical
Quoted 9 lines · Dan Carpenter
This debug code dereferences "
old_iface" after it was already freed by the call torelease_iface(). Re-order the debugging to avoid this issue.Fixes b54034a73baf ("cifs: during reconnect, update interface if necessary")Signed-off-by Dan Carpenter <[email protected]>--- fs/cifs/sess.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Reviewed-by Paulo Alcantara (SUSE) <[email protected]>
Signature · 3 lines
Thanks, Steve