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>] [day] [month] [year] [list]
Message-Id: <1577065774-25142-1-git-send-email-wang.yi59@zte.com.cn>
Date:   Mon, 23 Dec 2019 09:49:34 +0800
From:   Yi Wang <wang.yi59@....com.cn>
To:     aryabinin@...tuozzo.com
Cc:     glider@...gle.com, dvyukov@...gle.com, kasan-dev@...glegroups.com,
        linux-kernel@...r.kernel.org, xue.zhihong@....com.cn,
        wang.yi59@....com.cn, up2wing@...il.com, wang.liang82@....com.cn,
        Huang Zijiang <huang.zijiang@....com.cn>
Subject: [PATCH] lib: Use kzalloc() instead of kmalloc() with flag GFP_ZERO.

From: Huang Zijiang <huang.zijiang@....com.cn>

Use kzalloc instead of manually setting kmalloc
with flag GFP_ZERO since kzalloc sets allocated memory
to zero.

Signed-off-by: Huang Zijiang <huang.zijiang@....com.cn>
Signed-off-by: Yi Wang <wang.yi59@....com.cn>
---
 lib/test_kasan.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/test_kasan.c b/lib/test_kasan.c
index 05686c8..ff5d21e 100644
--- a/lib/test_kasan.c
+++ b/lib/test_kasan.c
@@ -598,7 +598,7 @@ static noinline void __init kasan_memchr(void)
     size_t size = 24;
 
     pr_info("out-of-bounds in memchr\n");
-    ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO);
+ptr = kzalloc(size, GFP_KERNEL);
     if (!ptr)
         return;
 
@@ -613,7 +613,7 @@ static noinline void __init kasan_memcmp(void)
     int arr[9];
 
     pr_info("out-of-bounds in memcmp\n");
-    ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO);
+ptr = kzalloc(size, GFP_KERNEL);
     if (!ptr)
         return;
 
@@ -628,7 +628,7 @@ static noinline void __init kasan_strings(void)
     size_t size = 24;
 
     pr_info("use-after-free in strchr\n");
-    ptr = kmalloc(size, GFP_KERNEL | __GFP_ZERO);
+ptr = kzalloc(size, GFP_KERNEL);
     if (!ptr)
         return;

-- 
1.9.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ