lkml.org 
[lkml]   [2016]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/5] x86, boot: Make memcpy handle overlaps

* Kees Cook <keescook@chromium.org> wrote:

> Two uses of memcpy (screen scrolling and ELF parsing) were handling
> overlapping memory areas. While there were no explicitly noticed bugs
> here (yet), it is best to fix this so that the copying will always be
> safe.
>
> Instead of making a new memmove function that might collide with other
> memmove definitions in the decompressors, this just makes the compressed
> boot's copy of memcpy overlap safe.

Btw., I changed all mentions of function calls to include a '()', i.e.:

Subject: x86/boot: Make memcpy() handle overlaps
From: Kees Cook <keescook@chromium.org>
Date: Wed, 20 Apr 2016 13:55:45 -0700

Two uses of memcpy() (screen scrolling and ELF parsing) were handling
overlapping memory areas. While there were no explicitly noticed bugs
here (yet), it is best to fix this so that the copying will always be
safe.

Instead of making a new memmove() function that might collide with other
memmove() definitions in the decompressors, this just makes the compressed
boot code's copy of memcpy() overlap-safe.

Please try to do this in future changelogs and patch titles, all references to
function calls should use parentheses, and all references to variables or
parameters should be escaped with '...' when it's not abundantly clear what they
are - this makes for much easier reading.

So just to mention an extreme (made up) example, which of these two commit titles
is less confusing to read:

Change out parameter of function to buffer to avoid confusion

or:

Change 'out' parameter of function() to 'buffer' to avoid confusion

?

I know which one I'd pick! ;-)

Thanks,

Ingo

\
 
 \ /
  Last update: 2016-04-22 10:01    [W:0.586 / U:0.264 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site