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: <1462167374-6321-1-git-send-email-chengang@emindsoft.com.cn>
Date:	Mon,  2 May 2016 13:36:14 +0800
From:	chengang@...ndsoft.com.cn
To:	akpm@...ux-foundation.org, aryabinin@...tuozzo.com,
	glider@...gle.com, dvyukov@...gle.com
Cc:	kasan-dev@...glegroups.com, linux-kernel@...r.kernel.org,
	linux-mm@...ck.org, Chen Gang <chengang@...ndsoft.com.cn>,
	Chen Gang <gang.chen.5i5j@...il.com>
Subject: [PATCH] mm/kasan/kasan.h: Fix boolean checking issue for kasan_report_enabled()

From: Chen Gang <chengang@...ndsoft.com.cn>

According to kasan_[dis|en]able_current() comments and the kasan_depth'
s initialization, if kasan_depth is zero, it means disable.

So need use "!!kasan_depth" instead of "!kasan_depth" for checking
enable.

Signed-off-by: Chen Gang <gang.chen.5i5j@...il.com>
---
 mm/kasan/kasan.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/kasan/kasan.h b/mm/kasan/kasan.h
index 7da78a6..6464b8f 100644
--- a/mm/kasan/kasan.h
+++ b/mm/kasan/kasan.h
@@ -102,7 +102,7 @@ static inline const void *kasan_shadow_to_mem(const void *shadow_addr)
 
 static inline bool kasan_report_enabled(void)
 {
-	return !current->kasan_depth;
+	return !!current->kasan_depth;
 }
 
 void kasan_report(unsigned long addr, size_t size,
-- 
1.9.3

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ