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: <alpine.DEB.1.00.0808291616170.15543@abydos.NerdBox.Net>
Date:	Fri, 29 Aug 2008 16:16:46 -0700 (PDT)
From:	Steve VanDeBogart <vandebo-lkml@...dBox.Net>
To:	linux-kernel@...r.kernel.org,
	user-mode-linux-devel@...ts.sourceforge.net, jiayingz@...gle.com,
	dkegel@...gle.com
Subject: [PATCH 4/6] VM: Annotate pagealloc

Valgrind annotations for valgrind: memory is addressable once it's been
alloced, and unaddressable when it is freed again.  Can't use malloc-like
and free-like because valgrind considers a malloc-like chunk indivisible.

Signed-off-by: Steve VanDeBogart <vandebo-lkml@...dbox.net>
---

Index: linux-2.6.27-rc5/mm/page_alloc.c
===================================================================
--- linux-2.6.27-rc5.orig/mm/page_alloc.c	2008-08-29 14:24:27.000000000 -0700
+++ linux-2.6.27-rc5/mm/page_alloc.c	2008-08-29 14:24:37.000000000 -0700
@@ -46,6 +46,7 @@
  #include <linux/page-isolation.h>
  #include <linux/memcontrol.h>
  #include <linux/debugobjects.h>
+#include <linux/memcheck.h>

  #include <asm/tlbflush.h>
  #include <asm/div64.h>
@@ -1080,6 +1081,7 @@
  		if (!page)
  			goto failed;
  	}
+	VALGRIND_MAKE_MEM_UNDEFINED(page_address(page), PAGE_SIZE << order);

  	__count_zone_vm_events(PGALLOC, zone, 1 << order);
  	zone_statistics(preferred_zone, zone);
@@ -1679,6 +1681,8 @@
  void __free_pages(struct page *page, unsigned int order)
  {
  	if (put_page_testzero(page)) {
+		VALGRIND_MAKE_MEM_NOACCESS(page_address(page),
+						PAGE_SIZE << order);
  		if (order == 0)
  			free_hot_page(page);
  		else
--
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