Rob Herring
d0f4bce2bc
tty: serial_core: fix NULL struct tty pointer access in uart_write_wakeup
...
Since commit 761ed4a94582ab29 ("tty: serial_core: convert uart_close to
use tty_port_close"), the serial console is broken on various systems
and typing "reboot" splats the following on the serial console:
INIT: Sending p[ 427.863916] BUG: unable to handle kernel NULL pointer dereference at 00000000000001e0
[ 427.885156] IP: [] tty_wakeup+0xc/0x70
[ 427.898337] PGD 0 [ 427.902051]
[ 427.907498] Oops: 0000 [#1 ] PREEMPT SMP
[ 427.917635] Modules linked in: nfsv3 nfs_acl nfs fscache lockd
sunrpc grace edd af_packet cpufreq_conservative cpufreq_userspace
cpufreq_powersave fuse loop md_mod dm_mod joydev hid_generic usbhid
ipmi_ssif ohci_pci ohci_hcd ehci_pci ehci_hcd e1000e ptp firewire_ohci
edac_core pps_core tpm_infineon sp5100_tco firewire_core acpi_cpufreq
serio_raw pcspkr fjes usbcore shpchp edac_mce_amd tpm_tis ipmi_si
tpm_tis_core i2c_piix4 k10temp sg ipmi_msghandler tpm sr_mod button
cdrom kvm_amd kvm irqbypass crc_itu_t ast ttm drm_kms_helper drm
fb_sys_fops sysimgblt sysfillrect syscopyarea i2c_algo_bit scsi_dh_rdac
scsi_dh_alua scsi_dh_emc scsi_dh_hp_sw ata_generic pata_atiixp
[ 428.054179] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 4.9.0-rc1-1.g73e3f23-default #1
[ 428.072868] Hardware name: System manufacturer System Product Name/KGP(M)E-D16, BIOS 0902 12/03/2010
[ 428.094755] task: ffffffffa2c0d500 task.stack: ffffffffa2c00000
[ 428.109717] RIP: 0010:[] [] tty_wakeup+0xc/0x70
[ 428.128407] RSP: 0018:ffff9a1a5fc03df8 EFLAGS: 00010086
[ 428.142184] RAX: ffff9a1857258000 RBX: ffffffffa3050ea0 RCX: 0000000000000000
[ 428.159649] RDX: 000000000000001b RSI: 0000000000000000 RDI: 0000000000000000
[ 428.177109] RBP: ffff9a1a5fc03e08 R08: 0000000000000000 R09: 0000000000000000
[ 428.194547] R10: 0000000000021c77 R11: 0000000000000000 R12: ffff9a1857258000
[ 428.212002] R13: 0000000000000000 R14: 0000000000000020 R15: 0000000000000020
[ 428.229481] FS: 0000000000000000(0000) GS:ffff9a1a5fc00000(0000) knlGS:0000000000000000
[ 428.248938] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 428.263726] CR2: 00000000000001e0 CR3: 0000000390c06000 CR4: 00000000000006f0
[ 428.281331] Stack:
[ 428.288696] ffffffffa3050ea0 ffff9a1857258000 ffff9a1a5fc03e18 ffffffffa24e0ab1
[ 428.307064] ffff9a1a5fc03e40 ffffffffa24e8865 ffffffffa3050ea0 00000000000000c2
[ 428.325456] 0000000000000046 ffff9a1a5fc03e78 ffffffffa24e8a5f ffffffffa3050ea0
[ 428.343905] Call Trace:
[ 428.352319] [ 428.356216] [] uart_write_wakeup+0x21/0x30
The problem is for console ports, the serial port is not shutdown and
interrupts may fire after the struct tty is gone. Simply calling the
tty_port helper tty_port_tty_wakeup instead of tty_wakeup directly will
ensure there is a valid struct tty.
Fixes: 761ed4a94582ab29 ("tty: serial_core: convert uart_close to use tty_port_close")
Reported-by: Borislav Petkov <bp@alien8.de>
Reported-by: Mike Galbraith <mgalbraith@suse.de>
Cc: Jiri Slaby <jslaby@suse.cz>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-serial@vger.kernel.org
Signed-off-by: Rob Herring <robh@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-28 08:13:07 -04:00
..
2016-10-27 16:41:56 +02:00
2015-10-04 19:09:21 +01:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-09-30 07:46:35 +02:00
2015-12-13 19:59:48 -08:00
2015-10-04 19:09:21 +01:00
2016-08-04 08:50:07 -04:00
2016-09-01 21:05:41 +02:00
2016-10-28 08:10:48 -04:00
2016-09-02 15:01:16 +02:00
2015-12-13 19:59:48 -08:00
2016-07-06 17:38:16 +02:00
2016-04-30 09:26:55 -07:00
2016-02-14 17:39:36 -08:00
2016-09-02 15:03:35 +02:00
2016-09-28 17:46:46 +02:00
2015-11-20 16:19:54 -08:00
2016-10-27 16:41:56 +02:00
2015-12-13 19:59:48 -08:00
2016-04-30 09:26:55 -07:00
2016-09-27 12:55:27 +02:00
2015-05-10 19:04:17 +02:00
2015-05-10 19:04:17 +02:00
2016-10-27 16:00:31 +02:00
2015-05-06 22:26:57 +02:00
2015-07-23 18:27:41 -07:00
2015-10-04 19:09:21 +01:00
2016-06-25 14:00:06 -07:00
2016-05-20 20:57:27 -07:00
2016-09-15 12:35:49 +02:00
2016-09-02 15:01:16 +02:00
2015-05-06 22:26:59 +02:00
2016-09-02 15:01:16 +02:00
2016-04-30 09:26:55 -07:00
2016-02-06 22:31:47 -08:00
2016-06-25 14:01:57 -07:00
2016-02-06 22:16:21 -08:00
2016-06-25 10:23:54 -07:00
2015-10-22 15:44:28 +02:00
2016-06-25 14:00:06 -07:00
2016-09-22 11:45:08 +02:00
2016-02-14 14:36:04 -08:00
2016-10-27 16:01:31 +02:00
2016-06-25 13:50:53 -07:00
2016-05-13 14:01:56 +02:00
2016-06-25 09:01:52 -07:00
2016-06-25 14:00:06 -07:00
2016-08-31 15:39:58 +02:00
2016-08-31 15:39:58 +02:00
2016-10-27 16:42:31 +02:00
2016-10-28 08:13:07 -04:00
2016-01-28 14:17:42 -08:00
2016-06-25 14:30:42 -07:00
2016-06-25 14:30:42 -07:00
2016-06-25 09:01:52 -07:00
2016-09-02 15:01:16 +02:00
2016-06-25 09:09:53 -07:00
2016-04-30 09:26:55 -07:00
2016-06-25 14:01:57 -07:00
2015-07-23 18:27:41 -07:00
2016-05-27 15:26:11 -07:00
2016-09-02 15:01:16 +02:00
2016-09-27 12:55:27 +02:00
2016-10-27 16:00:31 +02:00
2015-07-23 18:27:41 -07:00
2016-07-27 22:54:52 -07:00
2015-12-13 19:59:48 -08:00
2016-09-02 15:01:16 +02:00
2016-09-02 15:01:16 +02:00
2016-05-01 13:55:12 -07:00
2016-08-31 15:42:28 +02:00
2016-10-27 16:00:32 +02:00
2016-02-06 23:13:30 -08:00