Home
last modified time | relevance | path

Searched hist:"4047 b371" (Results 1 – 1 of 1) sorted by relevance

/openbmc/linux/drivers/tty/serial/
H A Dserial_core.c4047b371 Sat Apr 09 20:56:33 CDT 2016 Peter Hurley <peter@hurleysoftware.com> serial: core: Prevent unsafe uart port access, part 1

uart_remove_one_port() may race with every serial core operation
requiring a valid dereference of state->uart_port. In particular,
uart_remove_one_port() may unlink the uart port concurrently with
any serial core operation that may dereference same.

Ensure safe dereference for those operations that already claim
the port->mutex, and extend that guarantee for trivial cases,
such as the ioctl handlers. Introduce the uart_port_check() helper
which asserts port->mutex is held (only when lockdep is on).

For ioctls, return -EIO as if the port has been hung up (since it has).

Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>