]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/commit
serial: fsl_lpuart: Fix out-of-bounds access through DT alias
authorGeert Uytterhoeven <geert+renesas@glider.be>
Fri, 23 Feb 2018 13:38:30 +0000 (14:38 +0100)
committerStefan Bader <stefan.bader@canonical.com>
Tue, 14 Aug 2018 10:29:48 +0000 (12:29 +0200)
commitd460f7147126c026cbe60be869a2829da042f123
treee4df4c60dd57ba733c4bc7ba0b18cc3d68fb7164
parentc0c23f754c31eddbc0c4d20785ed2e2654b7145e
serial: fsl_lpuart: Fix out-of-bounds access through DT alias

BugLink: http://bugs.launchpad.net/bugs/1783418
[ Upstream commit ffab87fdecc655cc676f8be8dd1a2c5e22bd6d47 ]

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

Fix this by adding a range check.

Fixes: c9e2e946fb0ba5d2 ("tty: serial: add Freescale lpuart driver support")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Sasha Levin <alexander.levin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Khalid Elmously <khalid.elmously@canonical.com>
drivers/tty/serial/fsl_lpuart.c