summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorAlexander Inyukhin <shurick@sectorb.msk.ru>2015-09-26 15:24:21 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2015-10-04 11:01:13 +0100
commit1d5c47f555c5ae050fad22e4a99f88856cae5d05 (patch)
tree96e5c8c287c31a5b243345e11cd779927c24dae3 /drivers
parent8484bf2981b3d006426ac052a3642c9ce1d8d980 (diff)
downloadblackbird-op-linux-1d5c47f555c5ae050fad22e4a99f88856cae5d05.tar.gz
blackbird-op-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>
Diffstat (limited to 'drivers')
-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;
OpenPOWER on IntegriCloud