Skip to content

Commit

Permalink
USB: chaoskey read offset bug
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Alexander Inyukhin authored and Greg Kroah-Hartman committed Oct 4, 2015
1 parent 8484bf2 commit 1d5c47f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/usb/misc/chaoskey.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 1d5c47f

Please sign in to comment.