1
0
Fork 0
alistair23-linux/drivers/tty
He Zhe 352c4cf40c serial: 8250: Fix serial8250 initialization crash
The initialization code of interrupt backoff work might reference NULL
pointer and cause the following crash, if no port was found.

[   10.017727] CPU 0 Unable to handle kernel paging request at virtual address 000001b0, epc == 807088e0, ra == 8070863c
---- snip ----
[   11.704470] [<807088e0>] serial8250_register_8250_port+0x318/0x4ac
[   11.747251] [<80708d74>] serial8250_probe+0x148/0x1c0
[   11.789301] [<80728450>] platform_drv_probe+0x40/0x94
[   11.830515] [<807264f8>] really_probe+0xf8/0x318
[   11.870876] [<80726b7c>] __driver_attach+0x110/0x12c
[   11.910960] [<80724374>] bus_for_each_dev+0x78/0xcc
[   11.951134] [<80725958>] bus_add_driver+0x200/0x234
[   11.989756] [<807273d8>] driver_register+0x84/0x148
[   12.029832] [<80d72f84>] serial8250_init+0x138/0x198
[   12.070447] [<80100e6c>] do_one_initcall+0x5c/0x2a0
[   12.110104] [<80d3a208>] kernel_init_freeable+0x370/0x484
[   12.150722] [<80a49420>] kernel_init+0x10/0xf8
[   12.191517] [<8010756c>] ret_from_kernel_thread+0x14/0x1c

This patch makes sure the initialization code can be reached only if a port
is found.

Fixes: 6d7f677a2a ("serial: 8250: Rate limit serial port rx interrupts during input overruns")
Signed-off-by: He Zhe <zhe.he@windriver.com>
Reviewed-by: Darwin Dingel <darwin.dingel@alliedtelesis.co.nz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2019-01-18 13:03:47 +01:00
..
hvc tty: Use of_node_name_{eq,prefix} for node name comparisons 2018-12-17 16:12:17 +01:00
ipwireless ipwireless: switch to ->[sg]et_serial() 2018-10-13 00:50:31 -04:00
serdev serdev: document the write functions using kernel-doc 2018-11-27 19:44:21 +01:00
serial serial: 8250: Fix serial8250 initialization crash 2019-01-18 13:03:47 +01:00
vt TTY/Serial fixes for 4.20-rc2 2018-11-10 13:32:14 -06:00
Kconfig Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2018-04-09 09:04:10 -07:00
Makefile tty: remove bfin_jtag_comm and hvc_bfin_jtag drivers 2018-03-26 15:57:24 +02:00
amiserial.c kill TIOCSERGSTRUCT 2018-10-13 00:50:53 -04:00
cyclades.c cyclades: switch to ->[sg]et_serial() 2018-10-13 00:50:30 -04:00
ehv_bytechan.c tty: Convert to using %pOFn instead of device_node.name 2018-09-18 16:07:25 +02:00
goldfish.c headers: separate linux/mod_devicetable.h from linux/platform_device.h 2018-07-07 17:52:26 +02:00
isicom.c isicom: switch to ->[sg]et_serial() 2018-10-13 00:50:31 -04:00
mips_ejtag_fdc.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
moxa.c moxa: switch to ->[sg]et_serial() 2018-10-13 00:50:32 -04:00
moxa.h tty: moxa: Add support for CMSPAR 2017-11-28 15:32:33 +01:00
mxser.c mxser: switch to ->[sg]et_serial() 2018-10-13 00:50:32 -04:00
mxser.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
n_gsm.c change semantics of ldisc ->compat_ioctl() 2018-10-13 00:50:53 -04:00
n_hdlc.c Remove 'type' argument from access_ok() function 2019-01-03 18:57:57 -08:00
n_null.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_r3964.c tty: Don't block on IO when ldisc change is pending 2018-12-05 12:16:33 +01:00
n_tracerouter.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tracesink.c tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tracesink.h tty: Remove redundant license text 2017-11-08 13:08:12 +01:00
n_tty.c tty: Don't block on IO when ldisc change is pending 2018-12-05 12:16:33 +01:00
nozomi.c tty/nozomi: fix inconsistent indentation 2018-04-25 14:54:26 +02:00
pty.c pty: fix compat ioctls 2018-10-13 00:50:51 -04:00
rocket.c tty: rocket: Fix possible buffer overwrite on register_PCI 2018-08-02 10:11:32 +02:00
rocket.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
rocket_int.h License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
synclink.c synclink: reduce pointless checks in ->ioctl() 2018-10-13 00:50:43 -04:00
synclink_gt.c synclink_gt(): fix compat_ioctl() 2018-10-13 00:50:52 -04:00
synclinkmp.c synclink: reduce pointless checks in ->ioctl() 2018-10-13 00:50:43 -04:00
sysrq.c tty/sysrq: Do not call sync directly from sysrq_do_reset() 2018-12-05 12:02:12 +01:00
tty_audit.c audit: use current whenever possible 2018-11-26 18:41:21 -05:00
tty_baudrate.c termios, tty/tty_baudrate.c: fix buffer overrun 2018-11-08 03:36:45 -08:00
tty_buffer.c tty: wipe buffer. 2018-10-11 19:50:00 +02:00
tty_io.c tty: Don't hold ldisc lock in tty_reopen() if ldisc present 2019-01-11 17:03:42 +01:00
tty_ioctl.c move compat handling of tty ioctls to tty_compat_ioctl() 2018-09-14 11:12:17 -04:00
tty_jobctrl.c tty: add SPDX identifiers to all remaining files in drivers/tty/ 2017-11-08 13:08:12 +01:00
tty_ldisc.c tty/ldsem: Add lockdep asserts for ldisc_sem 2018-12-05 12:16:33 +01:00
tty_ldsem.c tty/ldsem: Decrement wait_readers on timeouted down_read() 2018-12-05 12:16:33 +01:00
tty_mutex.c License cleanup: add SPDX GPL-2.0 license identifier to files with no license 2017-11-02 11:10:55 +01:00
tty_port.c tty: do not set TTY_IO_ERROR flag if console port 2018-11-27 09:58:11 +01:00
vcc.c tty: vcc: Convert timers to use timer_setup() 2017-11-04 12:01:54 +01:00