Commit 297243e
smb: client: Fix next buffer leak in receive_encrypted_standard()
commit 1c6267a upstream.
receive_encrypted_standard() allocates next_buffer before checking
whether the number of compound PDUs already reached MAX_COMPOUND. If
the limit check fails, the function returns immediately and the newly
allocated next_buffer is not assigned to server->smallbuf/server->bigbuf,
making it leaked.
Move the MAX_COMPOUND check before allocating next_buffer.
Fixes: b24df3e ("cifs: update receive_encrypted_standard to handle compounded responses")
Cc: stable@vger.kernel.org
Signed-off-by: Haoxiang Li <haoxiang_li2024@163.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>1 parent d15d831 commit 297243e
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5096 | 5096 | | |
5097 | 5097 | | |
5098 | 5098 | | |
| 5099 | + | |
| 5100 | + | |
| 5101 | + | |
| 5102 | + | |
| 5103 | + | |
| 5104 | + | |
5099 | 5105 | | |
5100 | 5106 | | |
5101 | 5107 | | |
| |||
5119 | 5125 | | |
5120 | 5126 | | |
5121 | 5127 | | |
5122 | | - | |
5123 | | - | |
5124 | | - | |
5125 | | - | |
5126 | 5128 | | |
5127 | 5129 | | |
5128 | 5130 | | |
| |||
0 commit comments