lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1448272404-7031-3-git-send-email-enric.balletbo@collabora.com>
Date:	Mon, 23 Nov 2015 10:53:24 +0100
From:	Enric Balletbo i Serra <eballetbo@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	Anton Vorontsov <anton@...msg.org>,
	Colin Cross <ccross@...roid.com>,
	Kees Cook <keescook@...omium.org>,
	Tony Luck <tony.luck@...el.com>,
	Furquan Shaikh <furquan@...gle.com>,
	Aaron Durbin <adurbin@...omium.org>,
	Olof Johansson <olofj@...omium.org>,
	Andrew Bresticker <abrestic@...omium.org>,
	Puneet Kumar <puneetster@...omium.org>,
	tomeu.vizoso@...labora.co.uk, gustavo.padovan@...labora.co.uk,
	emilio.lopez@...labora.co.uk, sjoerd.simons@...labora.co.uk,
	Enric Balletbo Serra <enric.balletbo@...labora.com>
Subject: [PATCH 2/2] fs/pstore: Use memcpy_fromio() to save old ramoops buffer

From: Andrew Bresticker <abrestic@...omium.org>

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@...omium.org>
Reviewed-by: Puneet Kumar <puneetster@...omium.org>
Signed-off-by: Enric Balletbo Serra <enric.balletbo@...labora.com>
---
 fs/pstore/ram_core.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/pstore/ram_core.c b/fs/pstore/ram_core.c
index 351164d..5308277 100644
--- a/fs/pstore/ram_core.c
+++ b/fs/pstore/ram_core.c
@@ -322,8 +322,8 @@ void persistent_ram_save_old(struct persistent_ram_zone *prz)
 	}
 
 	prz->old_log_size = size;
-	memcpy(prz->old_log, &buffer->data[start], size - start);
-	memcpy(prz->old_log + size - start, &buffer->data[0], start);
+	memcpy_fromio(prz->old_log, &buffer->data[start], size - start);
+	memcpy_fromio(prz->old_log + size - start, &buffer->data[0], start);
 }
 
 int notrace persistent_ram_write(struct persistent_ram_zone *prz,
-- 
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ