Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp4368974rwb; Tue, 20 Sep 2022 12:54:48 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6EhOop7IN7gnLfK3NfefIBcxhiP+MRmmZCsOpWAi1LPq1KGHHRNNKORuHOKAog2NLOyq2L X-Received: by 2002:a05:6402:35cb:b0:451:6a0a:6688 with SMTP id z11-20020a05640235cb00b004516a0a6688mr21790073edc.415.1663703688017; Tue, 20 Sep 2022 12:54:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663703688; cv=none; d=google.com; s=arc-20160816; b=OqC4fGZl4V8Np4CWNMI0S/BYSKGG7kHrIL8glNG1IP+jLSLhknMFkAgkRtQl8u7IJ+ TxEwU0yhU7lKL1Ovp0p6a6tUYoEAXnZqAwuP5puuszS9q8b4n0mLmF0Zg1kwsy36bm3p bjg3PCC9nX29Cw8c58VMdjQdf0ThkSR3bvs3bgakfv55hsM7ygFtJjLqvOamWXy2GyGn WhGnb8pkDjkSEV/3MdAWkajWHXVk5mKMTNykhXt2sutSI3s7MVlNkYV4s/QOz7odu0Ns hFiJ1EupCricNGWswxQkTuFwweW2bhC8UWR95CBgL+cX9dXvm8/0eUjHGE6LOenmJTFa tnKQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nxHRTq1Yg5oxG8+GRDFsDxq7DRLYMtQhvc5Xaz+eRBo=; b=LCoG7n4UoWkOd8JAk3qce2gH6u6GQgiSOHby9LvIZE6S9KbOYMV80n0q9NBqvjJLcu xCxVE0Jjc8PY5WnI4NorqtHW8PTQPCXLUXXqaqAVG4tzkbEjwsfb23HgllR+lridm2Fx s7BP6MrcAGYOtbN5Y9qhErLNiU1rd5xdHZwGGuIdKQ+HnA1QU6m08O+awoY5uHMFPvWI iKamw25j/BF6FWxFCIZ4w9dCbLnGt3snfOQ56P8+obOSMyM7SBDc4YGP6/j00W8Hzuby nChINuMVKcEWIW1/rx/27qMuZb2J/WGZ/WrTyVgJt4pXXzq8eJhyWLB7UgO7h9HUJMbf LOxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=GnIONQpn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hd13-20020a170907968d00b0072fa13ddca0si756411ejc.229.2022.09.20.12.54.22; Tue, 20 Sep 2022 12:54:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=GnIONQpn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbiITS6Q (ORCPT + 99 others); Tue, 20 Sep 2022 14:58:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39872 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbiITS6P (ORCPT ); Tue, 20 Sep 2022 14:58:15 -0400 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28F4C7436D for ; Tue, 20 Sep 2022 11:58:14 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1663700291; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=nxHRTq1Yg5oxG8+GRDFsDxq7DRLYMtQhvc5Xaz+eRBo=; b=GnIONQpnE3duZHvOo+5gN7TANSJ5algfnUTlz4osbwGz6JHamLMPEVM23h6esM+h9+qHKa bCpDoOnA4Dmx37fBZ3d+147FVKjbz/I9acSA5E2aK4bqIOFNJCgL7eoQP6jpQoccG3JKSr Z+2DWjvy9TxuyxxjqN1Hw/+elcqw0wk= From: andrey.konovalov@linux.dev To: Andrew Morton Cc: Andrey Konovalov , Marco Elver , Alexander Potapenko , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, linux-mm@kvack.org, Yu Zhao , linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm] kasan: initialize read-write lock in stack ring Date: Tue, 20 Sep 2022 20:58:07 +0200 Message-Id: <576182d194e27531e8090bad809e4136953895f4.1663700262.git.andreyknvl@google.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andrey Konovalov Use __RW_LOCK_UNLOCKED to initialize stack_ring.lock. Reported-by: Yu Zhao Signed-off-by: Andrey Konovalov --- 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