diff options
Diffstat (limited to 'fs/smb/client/smb2file.c')
| -rw-r--r-- | fs/smb/client/smb2file.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/fs/smb/client/smb2file.c b/fs/smb/client/smb2file.c index 9bab3c57b3a4..8110f4e3f0a4 100644 --- a/fs/smb/client/smb2file.c +++ b/fs/smb/client/smb2file.c @@ -61,7 +61,10 @@ static struct smb2_symlink_err_rsp *symlink_data(const struct kvec *iov) cifs_dbg(FYI, "%s: skipping unhandled error context: 0x%x\n", __func__, le32_to_cpu(p->ErrorId)); - len = ALIGN(le32_to_cpu(p->ErrorDataLength), 8); + len = le32_to_cpu(p->ErrorDataLength); + if (len > end - ((u8 *)p + sizeof(*p))) + return ERR_PTR(-EINVAL); + len = ALIGN(len, 8); if (len > end - ((u8 *)p + sizeof(*p))) return ERR_PTR(-EINVAL); |
