lkml.org 
[lkml]   [2019]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: BUG: KASAN: global-out-of-bounds in ata_exec_internal_sg+0x50f/0xc70
On Tue, Jul 16, 2019 at 11:57 AM Steven Rostedt <rostedt@goodmis.org> wrote:
>
> On Tue, 16 Jul 2019 11:28:29 -0700
> Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> > The cited code looks like a check comparing that the pointer distance
> > is greater than the size of bytes being passed in. I'd wager
> > someone's calling memmove with overlapping memory regions when they
> > really wanted memcpy. Maybe a better question, is why was memmove
> > ever used; if there was some invariant that the memory regions
> > overlapped, why is that invariant no longer holding.
>
> I'm confused by the above statement as memmove() allows overlapping of
> src and dest, where as memcpy() does not.

Yes you're right; I confused the two. From the snippet in the
original email, it looks like the body of a fortified memcpy was
provided, and a memmove declaration was below it. So replace my
assumption of a bad call to memmove with a bad call to memcpy (which
should then make more sense, hopefully).
--
Thanks,
~Nick Desaulniers

\
 
 \ /
  Last update: 2019-07-16 21:47    [W:0.088 / U:13.920 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site