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-next>] [day] [month] [year] [list]
Message-ID: <1326261070-24427-1-git-send-email-tiejun.chen@windriver.com>
Date:	Wed, 11 Jan 2012 13:51:10 +0800
From:	Tiejun Chen <tiejun.chen@...driver.com>
To:	<catalin.marinas@....com>
CC:	<linux-kernel@...r.kernel.org>
Subject: [PATCH v2 1/1] kmemleak: only scan non-zero-size section

We should only scan that invalid section which size is not
zero as well.

Signed-off-by: Tiejun Chen <tiejun.chen@...driver.com>
---
change for v2
 * go a common point, kmemleak_scan_area(), to check size

 mm/kmemleak.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/mm/kmemleak.c b/mm/kmemleak.c
index 2c0d032..98d62e3 100644
--- a/mm/kmemleak.c
+++ b/mm/kmemleak.c
@@ -923,7 +923,7 @@ void __ref kmemleak_scan_area(const void *ptr, size_t size, gfp_t gfp)
 {
 	pr_debug("%s(0x%p)\n", __func__, ptr);
 
-	if (atomic_read(&kmemleak_enabled) && ptr && !IS_ERR(ptr))
+	if (atomic_read(&kmemleak_enabled) && ptr && size && !IS_ERR(ptr))
 		add_scan_area((unsigned long)ptr, size, gfp);
 	else if (atomic_read(&kmemleak_early_log))
 		log_early(KMEMLEAK_SCAN_AREA, ptr, size, 0);
-- 
1.6.0.4

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