]> git.baikalelectronics.ru Git - kernel.git/commit
staging: speakup: fix wraparound in uaccess length check
authorSamuel Thibault <samuel.thibault@ens-lyon.org>
Thu, 12 Jul 2018 22:29:36 +0000 (00:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2018 08:04:11 +0000 (10:04 +0200)
commit475b2152d9616667fa5b4a4beab03c0f31089808
tree893160b3923fce357d34268d3b0bdcce6f2e91e3
parent8a669ebd94cabf218da0a2a672fbb3d6133277e6
staging: speakup: fix wraparound in uaccess length check

If softsynthx_read() is called with `count < 3`, `count - 3` wraps, causing
the loop to copy as much data as available to the provided buffer. If
softsynthx_read() is invoked through sys_splice(), this causes an
unbounded kernel write; but even when userspace just reads from it
normally, a small size could cause userspace crashes.

Fixes: 4ba72441e9c5 ("speakup: add unicode variant of /dev/softsynth")
Cc: stable@vger.kernel.org
Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Signed-off-by: Jann Horn <jannh@google.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/speakup/speakup_soft.c