pstore/ram: Use memcpy_fromio() to save old buffer
authorAndrew Bresticker <abrestic@chromium.org>
Mon, 15 Feb 2016 08:19:49 +0000 (09:19 +0100)
committerWilly Tarreau <w@1wt.eu>
Fri, 10 Feb 2017 10:04:02 +0000 (11:04 +0100)
commit8996ef00ef17c7e8460bca5785c5f08794d9f589
tree4fbd50c74a8d7e2a87aee26a97124f26db710737
parent0d29b98a434751a1b7c654d4e437883f3f27fe51
pstore/ram: Use memcpy_fromio() to save old buffer

commit d771fdf94180de2bd811ac90cba75f0f346abf8d upstream.

The ramoops buffer may be mapped as either I/O memory or uncached
memory.  On ARM64, this results in a device-type (strongly-ordered)
mapping.  Since unnaligned accesses to device-type memory will
generate an alignment fault (regardless of whether or not strict
alignment checking is enabled), it is not safe to use memcpy().
memcpy_fromio() is guaranteed to only use aligned accesses, so use
that instead.

Signed-off-by: Andrew Bresticker <abrestic@chromium.org>
Signed-off-by: Enric Balletbo Serra <enric.balletbo@collabora.com>
Reviewed-by: Puneet Kumar <puneetster@chromium.org>
Signed-off-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Willy Tarreau <w@1wt.eu>
fs/pstore/ram_core.c