]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.19-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 May 2022 15:17:51 +0000 (17:17 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 May 2022 15:17:51 +0000 (17:17 +0200)
added patches:
tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch

queue-4.19/series
queue-4.19/tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch [new file with mode: 0644]

index 5085fe9a9d1149419d38d8332dfe2198645bec4a..d547cc07780bee55f184708704be6cd0bc00ac91 100644 (file)
@@ -29,3 +29,4 @@ cgroup-cpuset-remove-cpus_allowed-mems_allowed-setup-in-cpuset_init_smp.patch
 drm-vmwgfx-initialize-drm_mode_fb_cmd2.patch
 mips-fix-allmodconfig-build-with-latest-mkimage.patch
 ping-fix-address-binding-wrt-vrf.patch
+tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch
diff --git a/queue-4.19/tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch b/queue-4.19/tty-serial-digicolor-fix-possible-null-ptr-deref-in-digicolor_uart_probe.patch
new file mode 100644 (file)
index 0000000..cfbe8ec
--- /dev/null
@@ -0,0 +1,38 @@
+From 447ee1516f19f534a228dda237eddb202f23e163 Mon Sep 17 00:00:00 2001
+From: Yang Yingliang <yangyingliang@huawei.com>
+Date: Thu, 5 May 2022 20:46:21 +0800
+Subject: tty/serial: digicolor: fix possible null-ptr-deref in digicolor_uart_probe()
+
+From: Yang Yingliang <yangyingliang@huawei.com>
+
+commit 447ee1516f19f534a228dda237eddb202f23e163 upstream.
+
+It will cause null-ptr-deref when using 'res', if platform_get_resource()
+returns NULL, so move using 'res' after devm_ioremap_resource() that
+will check it to avoid null-ptr-deref.
+And use devm_platform_get_and_ioremap_resource() to simplify code.
+
+Fixes: 5930cb3511df ("serial: driver for Conexant Digicolor USART")
+Signed-off-by: Yang Yingliang <yangyingliang@huawei.com>
+Reviewed-by: Baruch Siach <baruch@tkos.co.il>
+Cc: stable <stable@vger.kernel.org>
+Link: https://lore.kernel.org/r/20220505124621.1592697-1-yangyingliang@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/digicolor-usart.c |    2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/digicolor-usart.c
++++ b/drivers/tty/serial/digicolor-usart.c
+@@ -472,10 +472,10 @@ static int digicolor_uart_probe(struct p
+               return PTR_ERR(uart_clk);
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+-      dp->port.mapbase = res->start;
+       dp->port.membase = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(dp->port.membase))
+               return PTR_ERR(dp->port.membase);
++      dp->port.mapbase = res->start;
+       irq = platform_get_irq(pdev, 0);
+       if (irq < 0)