]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 23 Feb 2018 12:44:19 +0000 (13:44 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Thu, 15 Mar 2018 13:27:33 +0000 (08:27 -0500)
commit59abce95cbe9b4cc353917d65f21f5336c32cc2d
treedc37f6ecde7bcddee92047d2b259d2489df22b03
parentc6fd25794e3c9c6497e3ab2985b819c39042787b
mmc: dw_mmc-k3: Fix out-of-bounds access through DT alias

BugLink: http://bugs.launchpad.net/bugs/1755179
commit 325501d9360eb42c7c51e6daa0d733844c1e790b upstream.

The hs_timing_cfg[] array is indexed using a value derived from the
"mshcN" alias in DT, which may lead to an out-of-bounds access.

Fix this by adding a range check.

Fixes: 361c7fe9b02eee7e ("mmc: dw_mmc-k3: add sd support for hi3660")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Shawn Lin <shawn.lin@rock-chips.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@canonical.com>
drivers/mmc/host/dw_mmc-k3.c