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: <1511855333-3570-11-git-send-email-iamjoonsoo.kim@lge.com>
Date:   Tue, 28 Nov 2017 16:48:45 +0900
From:   js1304@...il.com
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Andrey Ryabinin <aryabinin@...tuozzo.com>,
        Alexander Potapenko <glider@...gle.com>,
        Dmitry Vyukov <dvyukov@...gle.com>, kasan-dev@...glegroups.com,
        linux-mm@...ck.org, linux-kernel@...r.kernel.org,
        Namhyung Kim <namhyung@...nel.org>,
        Wengang Wang <wen.gang.wang@...cle.com>,
        Joonsoo Kim <iamjoonsoo.kim@....com>
Subject: [PATCH 10/18] vchecker: Use __GFP_ATOMIC to save stacktrace

From: Namhyung Kim <namhyung@...nel.org>

Since we're finding a cause of broken data, it'd be desired not to miss
any suspects.  It doesn't use GFP_ATOMIC since it includes __GFP_HIGH
which is for system making forward progress.

It also adds a WARN_ON whenever it fails to allocate pages even with
__GFP_ATOMIC.

Signed-off-by: Namhyung Kim <namhyung@...nel.org>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim@....com>
---
 mm/kasan/vchecker.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/mm/kasan/vchecker.c b/mm/kasan/vchecker.c
index 6b3824f..df480d5 100644
--- a/mm/kasan/vchecker.c
+++ b/mm/kasan/vchecker.c
@@ -301,13 +301,20 @@ static noinline depot_stack_handle_t save_stack(int skip, bool *is_new)
 		.max_entries = VCHECKER_STACK_DEPTH,
 		.skip = skip,
 	};
+	depot_stack_handle_t handle;
 
 	save_stack_trace(&trace);
 	if (trace.nr_entries != 0 &&
 	    trace.entries[trace.nr_entries-1] == ULONG_MAX)
 		trace.nr_entries--;
 
-	return depot_save_stack(NULL, &trace, GFP_NOWAIT, is_new);
+	if (trace.nr_entries == 0)
+		return 0;
+
+	handle = depot_save_stack(NULL, &trace, __GFP_ATOMIC, is_new);
+	WARN_ON(!handle);
+
+	return handle;
 }
 
 static ssize_t vchecker_type_write(struct file *filp, const char __user *ubuf,
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ