]> git.baikalelectronics.ru Git - kernel.git/commit
SMB3: Fix potential memory leak when processing compound chain
authorPavel Shilovsky <pshilov@microsoft.com>
Mon, 22 Jul 2019 18:38:22 +0000 (11:38 -0700)
committerSteve French <stfrench@microsoft.com>
Tue, 6 Aug 2019 03:50:13 +0000 (22:50 -0500)
commit71ef2436f5126c9fd8703b32a6f5695392b10087
tree6c4487f7274644d38f128e31e37bba38f9880085
parent3c650664081959c3ea74c2a0964f26cf8922fc2e
SMB3: Fix potential memory leak when processing compound chain

When a reconnect happens in the middle of processing a compound chain
the code leaks a buffer from the memory pool. Fix this by properly
checking for a return code and freeing buffers in case of error.

Also maintain a buf variable to be equal to either smallbuf or bigbuf
depending on a response buffer size while parsing a chain and when
returning to the caller.

Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
fs/cifs/smb2ops.c