]> www.infradead.org Git - users/dwmw2/linux.git/commit
ray_cs: Avoid reading past end of buffer
authorKees Cook <keescook@chromium.org>
Fri, 5 May 2017 22:38:41 +0000 (15:38 -0700)
committerSasha Levin <alexander.levin@microsoft.com>
Wed, 23 May 2018 01:36:25 +0000 (21:36 -0400)
commit5e2eee8e54bd31ede9110a6a4c620d07203a866b
tree5fa09473a173f11fc1004b31417d6c95d49b89f0
parentccb8434ef24aef1190dcfcab472cec05e0b992cf
ray_cs: Avoid reading past end of buffer

[ Upstream commit e48d661eb13f2f83861428f001c567fdb3f317e8 ]

Using memcpy() from a buffer that is shorter than the length copied means
the destination buffer is being filled with arbitrary data from the kernel
rodata segment. In this case, the source was made longer, since it did not
match the destination structure size. Additionally removes a needless cast.

This was found with the future CONFIG_FORTIFY_SOURCE feature.

Cc: Daniel Micay <danielmicay@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
drivers/net/wireless/ray_cs.c