]> git.baikalelectronics.ru Git - kernel.git/commit
wcn36xx: Avoid memset() beyond end of struct field
authorKees Cook <keescook@chromium.org>
Thu, 17 Jun 2021 17:10:58 +0000 (10:10 -0700)
committerKalle Valo <kvalo@codeaurora.org>
Tue, 22 Jun 2021 15:28:25 +0000 (18:28 +0300)
commit80ad430f7dde8eaf02c297aae450378b247a2746
tree73980a615c1428a669fcba845c6def58c8c30223
parent0d7e2f47b842a7d98765e3df77d7dda4aa350106
wcn36xx: Avoid memset() beyond end of struct field

In preparation for FORTIFY_SOURCE performing compile-time and run-time
field bounds checking for memset(), avoid intentionally writing across
neighboring array fields.

Instead of writing past the end of the header to reach the rest of
the body, replace the redundant function with existing macro to wipe
struct contents and set field values. Additionally adjusts macro to add
missing parens.

Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/20210617171058.3410494-1-keescook@chromium.org
drivers/net/wireless/ath/wcn36xx/smd.c