All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nigel Croxon <ncroxon@redhat.com>
To: Paul Menzel <pmenzel@molgen.mpg.de>
Cc: jes@trained-monkey.org, mariusz.tkaczyk@linux.intel.com,
	neilb@suse.de, xni@redhat.com, linux-raid@vger.kernel.org
Subject: Re: [PATCH] Fix potential overlap dest buffer
Date: Wed, 18 Aug 2021 14:22:07 -0400	[thread overview]
Message-ID: <72098bc8-4429-6711-8b90-d5bf1e195ad8@redhat.com> (raw)
In-Reply-To: <6ffc271e-c24e-aaf7-7392-0041f26e4bf2@molgen.mpg.de>

On 8/18/21 2:34 AM, Paul Menzel wrote:
> Dear Nigel,
> 
> 
> Am 17.08.21 um 15:14 schrieb Nigel Croxon:
>> To meet requirements of Common Criteria certification vulnerablility
> 
> vulnerability
> 
>> assessment.
> 
> That’s only part of a sentence? Is that supposed to be read as a 
> continuation of the commit message summary: … to meet requirements …?
> 

Continuation of the commit message. Thanks for catching the
spelling mistake.

>> Static code analysis has been run and found the following
>> error.  Overlapping_buffer: The source buffer potentially overlaps
> 
> It’d be great, if you denoted, which tool was run. Maybe even add a 
> Found-by tag.
> 

I ran the Coverity scan on the latest build.
https://people.redhat.com/ncroxon/mdadm-4.2-rc2-scan-results.html


>> with the destination buffer, which results in undefined
>> behavior for "memcpy".
>>
>> The change is to use memmove instead of memcpy.
>>
>> Signed-off-by: Nigel Croxon <ncroxon@redhat.com>
>> ---
>>   sha1.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/sha1.c b/sha1.c
>> index 11be7045..89b32f46 100644
>> --- a/sha1.c
>> +++ b/sha1.c
>> @@ -258,7 +258,7 @@ sha1_process_bytes (const void *buffer, size_t 
>> len, struct sha1_ctx *ctx)
>>       {
>>         sha1_process_block (ctx->buffer, 64, ctx);
>>         left_over -= 64;
>> -      memcpy (ctx->buffer, &ctx->buffer[16], left_over);
>> +      memmove (ctx->buffer, &ctx->buffer[16], left_over);
>>       }
>>         ctx->buflen = left_over;
>>       }
> 
> Reviewed-by: Paul Menzel <pmenzel@molgen.mpg.de>
> 
> 
> Kind regards,
> 
> Paul
> 


  reply	other threads:[~2021-08-18 18:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 13:14 [PATCH] Fix potential overlap dest buffer Nigel Croxon
2021-08-17 21:40 ` NeilBrown
2021-08-18  6:34 ` Paul Menzel
2021-08-18 18:22   ` Nigel Croxon [this message]
2021-10-08 15:50 ` Jes Sorensen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72098bc8-4429-6711-8b90-d5bf1e195ad8@redhat.com \
    --to=ncroxon@redhat.com \
    --cc=jes@trained-monkey.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=mariusz.tkaczyk@linux.intel.com \
    --cc=neilb@suse.de \
    --cc=pmenzel@molgen.mpg.de \
    --cc=xni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.