From: Alexander Inyukhin Date: Sat, 26 Sep 2015 12:24:21 +0000 (+0300) Subject: USB: chaoskey read offset bug X-Git-Tag: v4.3-rc5~7^2~1 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=1d5c47f555c5ae050fad22e4a99f88856cae5d05;p=karo-tx-linux.git USB: chaoskey read offset bug Rng reads in chaoskey driver could return the same data under the certain conditions. Signed-off-by: Alexander Inyukhin Cc: stable Signed-off-by: Greg Kroah-Hartman --- 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;