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]
Date:	Mon, 12 May 2008 18:32:04 +0800
From:	Bryan Wu <cooloney@...nel.org>
To:	linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	dwmw2@...radead.org
Cc:	Jie Zhang <jie.zhang@...log.com>, Bryan Wu <cooloney@...nel.org>
Subject: [PATCH 3/4] [mm/nommu]: use copy_to_user_page to call flush icache for [#811] toolchain old bug

From: Jie Zhang <jie.zhang@...log.com>

access_process_vm in mm/memory.c uses copy_to_user_page and
copy_from_user_page. So for !MMU we'd better do the same thing.
Other archs with mmu do the cache flush in copy_to_user_page.
It gives me hint that copy_to_user_page is designed to flush
the cache. On other side, no archs do the cache flush ptrace.

Signed-off-by: Jie Zhang <jie.zhang@...log.com>
Signed-off-by: Bryan Wu <cooloney@...nel.org>
---
 mm/nommu.c |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/mm/nommu.c b/mm/nommu.c
index c11e5cc..56bb447 100644
--- a/mm/nommu.c
+++ b/mm/nommu.c
@@ -1458,9 +1458,11 @@ int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, in
 
 		/* only read or write mappings where it is permitted */
 		if (write && vma->vm_flags & VM_MAYWRITE)
-			len -= copy_to_user((void *) addr, buf, len);
+			copy_to_user_page(vma, NULL, NULL,
+					  (void *) addr, buf, len);
 		else if (!write && vma->vm_flags & VM_MAYREAD)
-			len -= copy_from_user(buf, (void *) addr, len);
+			copy_from_user_page(vma, NULL, NULL,
+					    buf, (void *) addr, len);
 		else
 			len = 0;
 	} else {
-- 
1.5.5

--
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