mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
smb: client: fix double-free in SMB2_ioctl() replay
A response-bearing attempt can return a replayable error and free its
response buffer. If SMB2_ioctl_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: 4f1fffa237 ("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>
This commit is contained in:
parent
b55e182f23
commit
f9bbadb6c9
|
|
@ -3532,6 +3532,8 @@ SMB2_ioctl(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_fid,
|
|||
|
||||
replay_again:
|
||||
/* reinitialize for possible replay */
|
||||
resp_buftype = CIFS_NO_BUFFER;
|
||||
memset(&rsp_iov, 0, sizeof(rsp_iov));
|
||||
flags = 0;
|
||||
server = cifs_pick_channel(ses);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user