From: Dmitry Vyukov Date: Tue, 29 Sep 2015 22:54:58 +0000 (-0700) Subject: Input: psmouse - fix data race in __ps2_command X-Git-Tag: omap-for-v4.3/fixes-rc5~48^2~1 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=218c1f76b8b25d6dc9d01443f071cb618e206b0c;p=pandora-kernel.git Input: psmouse - fix data race in __ps2_command The data race happens on ps2dev->cmdcnt and ps2dev->cmdbuf contents. __ps2_command reads that data concurrently with the interrupt handler. As the result, for example, if a response arrives just after the timeout, __ps2_command can copy out garbage from ps2dev->cmdbuf but then see that ps2dev->cmdcnt is 0 and return success. Stop the interrupt handler with serio_pause_rx() before reading the results. The data race was found with KernelThreadSanitizer (KTSAN). Signed-off-by: Dmitry Vyukov Signed-off-by: Dmitry Torokhov --- Reading git-diff-tree failed