]> git.ipfire.org Git - thirdparty/linux.git/commit
cifs: Avoid field over-reading memcpy()
authorKees Cook <keescook@chromium.org>
Mon, 21 Jun 2021 21:44:46 +0000 (14:44 -0700)
committerSteve French <stfrench@microsoft.com>
Tue, 22 Jun 2021 02:39:46 +0000 (21:39 -0500)
commitfbcff33d4204cbcb8e60faa3465a2156fdda398a
tree22791ddeee3647d405c7a86d580a445ec62e4d42
parente0ae8a9aaeed7262f349e025b2162e8a13cb58d9
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>
fs/cifs/smb2pdu.c