tty: fix data race in flush_to_ldisc
flush_to_ldisc reads port->itty and checks that it is not NULL, concurrently release_tty sets port->itty to NULL. It is possible that flush_to_ldisc loads port->itty once, ensures that it is not NULL, but then reloads it again and uses. The second load can already return NULL, which will cause a crash. Use READ_ONCE to read port->itty. The data race was found with KernelThreadSanitizer (KTSAN). Change-Id: I9dcd01dcc82a6f9d4fe17ee54bb70acc7e731765 Signed-off-by:Dmitry Vyukov <dvyukov@google.com> Reviewed-by:
Peter Hurley <peter@hurleysoftware.com> Signed-off-by:
Greg Kroah-Hartman <gregkh@linuxfoundation.org> Git-commit: 7098296a362a96051fa120abf48f0095818b99cd Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git Signed-off-by:
lingutla <clingutla@codeaurora.org>
Loading
Please register or sign in to comment