staging: rtl8723bs: Avoid field-overflowing memcpy()
In preparation for FORTIFY_SOURCE performing compile-time and run-time field bounds checking for memcpy(), memmove(), and memset(), avoid intentionally writing across neighboring fields. Adjust memcpy() destination to be the named structure itself, rather than the first member, allowing memcpy() to correctly reason about the size. "objdump -d" shows no object code changes. Cc: Ross Schmidt <ross.schm.dev@gmail.com> Cc: Joe Perches <joe@perches.com> Cc: devel@driverdev.osuosl.org Signed-off-by:Kees Cook <keescook@chromium.org> Link: https://lore.kernel.org/r/20210806201422.2871679-1-keescook@chromium.orgSigned-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing
Please register or sign in to comment