summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Inyukhin2015-09-26 14:24:21 +0200
committerGreg Kroah-Hartman2015-10-04 12:01:13 +0200
commit1d5c47f555c5ae050fad22e4a99f88856cae5d05 (patch)
tree96e5c8c287c31a5b243345e11cd779927c24dae3
parentUSB: Add reset-resume quirk for two Plantronics usb headphones. (diff)
downloadkernel-qcow2-linux-1d5c47f555c5ae050fad22e4a99f88856cae5d05.tar.gz
kernel-qcow2-linux-1d5c47f555c5ae050fad22e4a99f88856cae5d05.tar.xz
kernel-qcow2-linux-1d5c47f555c5ae050fad22e4a99f88856cae5d05.zip
USB: chaoskey read offset bug
Rng reads in chaoskey driver could return the same data under the certain conditions. Signed-off-by: Alexander Inyukhin <shurick@sectorb.msk.ru> Cc: stable <stable@vger.kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/usb/misc/chaoskey.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index 3ad5d19e4d04..23c794813e6a 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -472,7 +472,7 @@ static int chaoskey_rng_read(struct hwrng *rng, void *data,
if (this_time > max)
this_time = max;
- memcpy(data, dev->buf, this_time);
+ memcpy(data, dev->buf + dev->used, this_time);
dev->used += this_time;