]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
pinctrl: samsung: Validate alias coming from DT
authorKrzysztof Kozlowski <krzk@kernel.org>
Tue, 20 Feb 2018 18:17:51 +0000 (19:17 +0100)
committerSeth Forshee <seth.forshee@canonical.com>
Wed, 28 Mar 2018 19:04:39 +0000 (14:04 -0500)
commitf0c1a7631b2214a4b7295bb06136209d4b5be584
tree929bb891984eed3cb568ce84c22c89a4ec843432
parent8f2cf8ea26b6c13e5d68e88156d9e436bd387aae
pinctrl: samsung: Validate alias coming from DT

BugLink: http://bugs.launchpad.net/bugs/1759655
commit 93b0beae721b3344923b4b8317e9d83b542f4ca6 upstream.

Driver uses alias from Device Tree as an index of pin controller data
array.  In case of a wrong DTB or an out-of-tree DTB, the alias could be
outside of this data array leading to out-of-bounds access.

Depending on binary and memory layout, this could be handled properly
(showing error like "samsung-pinctrl 3860000.pinctrl: driver data not
available") or could lead to exceptions.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: <stable@vger.kernel.org>
Fixes: 30574f0db1b1 ("pinctrl: add samsung pinctrl and gpiolib driver")
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Seth Forshee <seth.forshee@canonical.com>
drivers/pinctrl/samsung/pinctrl-exynos-arm.c
drivers/pinctrl/samsung/pinctrl-exynos-arm64.c
drivers/pinctrl/samsung/pinctrl-s3c24xx.c
drivers/pinctrl/samsung/pinctrl-s3c64xx.c
drivers/pinctrl/samsung/pinctrl-samsung.c
drivers/pinctrl/samsung/pinctrl-samsung.h