]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()
authorJohannes Thumshirn <jthumshirn@suse.de>
Thu, 6 Aug 2015 07:16:37 +0000 (09:16 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 21 Sep 2015 17:10:53 +0000 (10:10 -0700)
commitf803126238a4d14067455a5a083055478a29a833
treed66d7021551a8e0bf6a4f00a5681f2a55e0a3aef
parente611a710330e4c255b17500c9824fbaacb4d1e4a
tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()

commit 8117e347406278fd399b077add4e638cd017ae2d upstream.

Fix panic caused by a race between men_z135_intr() and men_z135_set_termios().

men_z135_intr() and men_z135_set_termios() both hold the struct uart_port::lock
spinlock, but men_z135_intr() does a spin_lock_irqsave() and
men_z135_set_termios() does a normal spin_lock(), which can lead to a deadlock
when an interrupt is called while the lock is being helt by
men_z135_set_termios().

This was discovered using a insmod, hardware looppback send/receive, rmmod
stress test.

Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
Cc: Andreas Werner <andreas.werner@men.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/tty/serial/men_z135_uart.c