diff options
| author | Pavel Shilovsky <pshilov@microsoft.com> | 2016-11-29 16:14:43 -0800 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-07-04 11:51:01 +0200 |
| commit | 3fab4ae8a91bf527d250979f5da811de8949a826 (patch) | |
| tree | 6ad5b2177c1af22319867e29c0508f2f35c91a3a | |
| parent | 5d44cc001c7725b6c4a2c6c8da5b45b9dab0849f (diff) | |
CIFS: Fix a possible memory corruption in push locks
commit e3d240e9d505fc67f8f8735836df97a794bbd946 upstream.
If maxBuf is not 0 but less than a size of SMB2 lock structure
we can end up with a memory corruption.
Signed-off-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
| -rw-r--r-- | fs/cifs/smb2file.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/smb2file.c b/fs/cifs/smb2file.c index d801f63cd..866caf1d2 100644 --- a/fs/cifs/smb2file.c +++ b/fs/cifs/smb2file.c @@ -266,7 +266,7 @@ smb2_push_mandatory_locks(struct cifsFileInfo *cfile) * and check it for zero before using. */ max_buf = tlink_tcon(cfile->tlink)->ses->server->maxBuf; - if (!max_buf) { + if (max_buf < sizeof(struct smb2_lock_element)) { free_xid(xid); return -EINVAL; } |
