Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var
authorYoung Xiao <YangX92@hotmail.com>
Fri, 12 Apr 2019 07:45:06 +0000 (15:45 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 22 Jun 2019 06:17:19 +0000 (08:17 +0200)
commit32f99125fe6227128ec4e8996884db74b9dc3062
treea59358731495f1f66548be7bf67299bb9f478daa
parent881a09fbbe957eaff923270a17b15d20a852589b
Drivers: misc: fix out-of-bounds access in function param_set_kgdbts_var

[ Upstream commit b281218ad4311a0342a40cb02fb17a363df08b48 ]

There is an out-of-bounds access to "config[len - 1]" array when the
variable "len" is zero.

See commit dada6a43b040 ("kgdboc: fix KASAN global-out-of-bounds bug
in param_set_kgdboc_var()") for details.

Signed-off-by: Young Xiao <YangX92@hotmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/misc/kgdbts.c