[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <576182d194e27531e8090bad809e4136953895f4.1663700262.git.andreyknvl@google.com>
Date: Tue, 20 Sep 2022 20:58:07 +0200
From: andrey.konovalov@...ux.dev
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Andrey Konovalov <andreyknvl@...il.com>,
Marco Elver <elver@...gle.com>,
Alexander Potapenko <glider@...gle.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Andrey Ryabinin <ryabinin.a.a@...il.com>,
kasan-dev@...glegroups.com, linux-mm@...ck.org,
Yu Zhao <yuzhao@...gle.com>, linux-kernel@...r.kernel.org,
Andrey Konovalov <andreyknvl@...gle.com>
Subject: [PATCH mm] kasan: initialize read-write lock in stack ring
From: Andrey Konovalov <andreyknvl@...gle.com>
Use __RW_LOCK_UNLOCKED to initialize stack_ring.lock.
Reported-by: Yu Zhao <yuzhao@...gle.com>
Signed-off-by: Andrey Konovalov <andreyknvl@...gle.com>
---
Andrew, could you please fold this patch into:
"kasan: implement stack ring for tag-based modes".
---
mm/kasan/tags.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/mm/kasan/tags.c b/mm/kasan/tags.c
index 9d867cae1b7b..67a222586846 100644
--- a/mm/kasan/tags.c
+++ b/mm/kasan/tags.c
@@ -36,7 +36,9 @@ DEFINE_STATIC_KEY_TRUE(kasan_flag_stacktrace);
/* Non-zero, as initial pointer values are 0. */
#define STACK_RING_BUSY_PTR ((void *)1)
-struct kasan_stack_ring stack_ring;
+struct kasan_stack_ring stack_ring = {
+ .lock = __RW_LOCK_UNLOCKED(stack_ring.lock)
+};
/* kasan.stacktrace=off/on */
static int __init early_kasan_flag_stacktrace(char *arg)
--
2.25.1
Powered by blists - more mailing lists