Commit 07e0ab8
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 eb4736a commit 07e0ab8
1 file changed
Lines changed: 6 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5189 | 5189 | | |
5190 | 5190 | | |
5191 | 5191 | | |
| 5192 | + | |
| 5193 | + | |
| 5194 | + | |
| 5195 | + | |
| 5196 | + | |
| 5197 | + | |
5192 | 5198 | | |
5193 | 5199 | | |
5194 | 5200 | | |
| |||
5212 | 5218 | | |
5213 | 5219 | | |
5214 | 5220 | | |
5215 | | - | |
5216 | | - | |
5217 | | - | |
5218 | | - | |
5219 | 5221 | | |
5220 | 5222 | | |
5221 | 5223 | | |
| |||
0 commit comments