]> git.baikalelectronics.ru Git - kernel.git/commit
orinoco: Avoid field-overflowing memcpy()
authorKees Cook <keescook@chromium.org>
Wed, 16 Jun 2021 20:39:51 +0000 (13:39 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 22 Jun 2021 15:23:35 +0000 (18:23 +0300)
commit49b25b1ba4c13d5e8c589fc783f96f0ea2db4cde
tree8ea07c74e12ea05739f6ba371907fe45debedef5
parent1db0a13104b0213bbf96930346a467ed8af6158e
orinoco: 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 array fields.

Validate the expected key size and introduce a wrapping structure
to use as the multi-field memcpy() destination so that overflows
can be correctly detected.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210616203952.1248910-1-keescook@chromium.org
drivers/net/wireless/intersil/orinoco/hw.c
drivers/net/wireless/intersil/orinoco/hw.h
drivers/net/wireless/intersil/orinoco/wext.c