Re: [PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Herbert Xu
On Fri, Jul 17, 2020 at 08:59:54AM +0300, Ard Biesheuvel wrote: > > Or change it to b[1] = b[0] (assuming the compiler allows struct > assignment in that way). This will always copy XTS_BLOCK_SIZE bytes, > but we have sufficient space, and it is probably more efficient too > in most cases. Sounds

Re: [PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Ard Biesheuvel
On Fri, 17 Jul 2020 at 08:21, Herbert Xu wrote: > > On Thu, Jul 16, 2020 at 06:56:30PM +0300, Ard Biesheuvel wrote: > > On Thu, 16 Jul 2020 at 18:29, Colin King wrote: > > > > > > From: Colin Ian King > > > > > > There is a memcpy that performs a potential overlapped memory copy > > > from sourc

Re: [PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Herbert Xu
On Thu, Jul 16, 2020 at 06:56:30PM +0300, Ard Biesheuvel wrote: > On Thu, 16 Jul 2020 at 18:29, Colin King wrote: > > > > From: Colin Ian King > > > > There is a memcpy that performs a potential overlapped memory copy > > from source b to destination b + 1. Fix this by using the safer > > memmov

Re: [PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Colin Ian King
On 16/07/2020 16:56, Ard Biesheuvel wrote: > On Thu, 16 Jul 2020 at 18:29, Colin King wrote: >> >> From: Colin Ian King >> >> There is a memcpy that performs a potential overlapped memory copy >> from source b to destination b + 1. Fix this by using the safer >> memmove instead. >> >> Addresses-

Re: [PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Ard Biesheuvel
On Thu, 16 Jul 2020 at 18:29, Colin King wrote: > > From: Colin Ian King > > There is a memcpy that performs a potential overlapped memory copy > from source b to destination b + 1. Fix this by using the safer > memmove instead. > > Addresses-Coverity: ("Overlapping buffer in memory copy") > Fix

[PATCH] crypto: xts: use memmove to avoid overlapped memory copy

2020-07-16 Thread Colin King
From: Colin Ian King There is a memcpy that performs a potential overlapped memory copy from source b to destination b + 1. Fix this by using the safer memmove instead. Addresses-Coverity: ("Overlapping buffer in memory copy") Fixes: 8083b1bf8163 ("crypto: xts - add support for ciphertext steal