lkml.org 
[lkml]   [2022]   [Apr]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] random: use memmove instead of memcpy for remaining 32 bytes
Am Thu, Apr 14, 2022 at 01:56:49AM +0200 schrieb Jason A. Donenfeld:
> In order to immediately overwrite the old key on the stack, before
> servicing a userspace request for bytes, we use the remaining 32 bytes
> of block 0 as the key. This means moving indices 8,9,a,b,c,d,e,f ->
> 4,5,6,7,8,9,a,b. Since 4 < 8, for the kernel implementations of
> memcpy(), this doesn't actually appear to be a problem in practice. But
> relying on that characteristic seems a bit brittle. So let's change that
> to a proper memmove(), which is the by-the-books way of handling
> overlapping memory copies.
>
> Cc: Dominik Brodowski <linux@dominikbrodowski.net>
> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>

Reviewed-by: Dominik Brodowski <linux@dominikbrodowski.net>

Thanks,
Dominik

\
 
 \ /
  Last update: 2022-04-15 08:16    [W:2.881 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site