]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
smb: client: fix double-free in SMB2_close() replay
authorHenrique Carvalho <henrique.carvalho@suse.com>
Thu, 18 Jun 2026 20:34:35 +0000 (17:34 -0300)
committerSteve French <stfrench@microsoft.com>
Thu, 18 Jun 2026 23:12:23 +0000 (18:12 -0500)
commitf96e1cdcb63ed3321142ff2fcdf784e32cda8fee
tree21fdc7cf19a04ba8064396044907a1d5146a5a66
parentf9bbadb6c94583e3b4af1afc449bfceb1d1ddec9
smb: client: fix double-free in SMB2_close() replay

A response-bearing attempt can return a replayable error and free its
response buffer. If SMB2_close_init() fails before the next send, cleanup
retains the previous buffer type and frees that response again.

Reset response bookkeeping before each attempt to prevent the stale free.

Fixes: 4f1fffa23769 ("cifs: commands that are retried should have replay flag set")
Cc: stable@vger.kernel.org
Signed-off-by: Henrique Carvalho <henrique.carvalho@suse.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/smb/client/smb2pdu.c