mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-08 15:04:45 +00:00
cifs: Avoid field over-reading memcpy()
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally reading across neighboring fields. Instead of using memcpy to read across multiple struct members, just perform per-member assignments as already done for other members. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Steve French <stfrench@microsoft.com>
This commit is contained in:
parent
e0ae8a9aae
commit
fbcff33d42
@ -2892,7 +2892,10 @@ SMB2_open(const unsigned int xid, struct cifs_open_parms *oparms, __le16 *path,
|
||||
#endif /* CIFS_DEBUG2 */
|
||||
|
||||
if (buf) {
|
||||
memcpy(buf, &rsp->CreationTime, 32);
|
||||
buf->CreationTime = rsp->CreationTime;
|
||||
buf->LastAccessTime = rsp->LastAccessTime;
|
||||
buf->LastWriteTime = rsp->LastWriteTime;
|
||||
buf->ChangeTime = rsp->ChangeTime;
|
||||
buf->AllocationSize = rsp->AllocationSize;
|
||||
buf->EndOfFile = rsp->EndofFile;
|
||||
buf->Attributes = rsp->FileAttributes;
|
||||
|
Loading…
Reference in New Issue
Block a user