]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Jul 2022 15:50:09 +0000 (17:50 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 18 Jul 2022 15:50:09 +0000 (17:50 +0200)
added patches:
serial-8250-fix-return-error-code-in-serial8250_request_std_resource.patch

queue-4.14/serial-8250-fix-return-error-code-in-serial8250_request_std_resource.patch [new file with mode: 0644]
queue-4.14/series

diff --git a/queue-4.14/serial-8250-fix-return-error-code-in-serial8250_request_std_resource.patch b/queue-4.14/serial-8250-fix-return-error-code-in-serial8250_request_std_resource.patch
new file mode 100644 (file)
index 0000000..ddd928e
--- /dev/null
@@ -0,0 +1,39 @@
+From 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 Mon Sep 17 00:00:00 2001
+From: Yi Yang <yiyang13@huawei.com>
+Date: Tue, 28 Jun 2022 16:35:15 +0800
+Subject: serial: 8250: fix return error code in serial8250_request_std_resource()
+
+From: Yi Yang <yiyang13@huawei.com>
+
+commit 6e690d54cfa802f939cefbd2fa2c91bd0b8bd1b6 upstream.
+
+If port->mapbase = NULL in serial8250_request_std_resource() , it need
+return a error code instead of 0. If uart_set_info() fail to request new
+regions by serial8250_request_std_resource() but the return value of
+serial8250_request_std_resource() is 0, The system incorrectly considers
+that the resource application is successful and does not attempt to
+restore the old setting. A null pointer reference is triggered when the
+port resource is later invoked.
+
+Signed-off-by: Yi Yang <yiyang13@huawei.com>
+Cc: stable <stable@kernel.org>
+Link: https://lore.kernel.org/r/20220628083515.64138-1-yiyang13@huawei.com
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+---
+ drivers/tty/serial/8250/8250_port.c |    4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/drivers/tty/serial/8250/8250_port.c
++++ b/drivers/tty/serial/8250/8250_port.c
+@@ -2884,8 +2884,10 @@ static int serial8250_request_std_resour
+       case UPIO_MEM32BE:
+       case UPIO_MEM16:
+       case UPIO_MEM:
+-              if (!port->mapbase)
++              if (!port->mapbase) {
++                      ret = -EINVAL;
+                       break;
++              }
+               if (!request_mem_region(port->mapbase, size, "serial")) {
+                       ret = -EBUSY;
index 4416bb05494c61ecf36f206fa36a3f318632e5bb..17fb8ed552c5b344e21fb55ebe7ff7f4b54dfaf1 100644 (file)
@@ -38,3 +38,4 @@ signal-handling-don-t-use-bug_on-for-debugging.patch
 usb-serial-ftdi_sio-add-belimo-device-ids.patch
 usb-dwc3-gadget-fix-event-pending-check.patch
 tty-serial-samsung_tty-set-dma-burst_size-to-1.patch
+serial-8250-fix-return-error-code-in-serial8250_request_std_resource.patch