From patchwork Wed Dec 9 18:24:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrey Konovalov X-Patchwork-Id: 11962033 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, UNWANTED_LANGUAGE_BODY,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DEA2CC4167B for ; Wed, 9 Dec 2020 18:26:03 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 93C6A23BC6 for ; Wed, 9 Dec 2020 18:26:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93C6A23BC6 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:To:From:Subject:References:Mime-Version:Message-Id: In-Reply-To:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=tdb0taFhUEmxAL9v9CTrXfskSUKtfufHSNudhqW7878=; b=HSY0GsM4sPC/YiGHoT4ZIGwVZ 8AlSGcXJ5bfEuFKdyFB4t7b+A77G6curB/S5WM3AKc3GV27pOeHDN3LAapgTQMz6oFSnj7Iu9jCBj H7Ss1YSYG71NFqBrphJTgmJcUUEBrv1Yzw8i4qAKHlqnJuf6fgLNftitVkzmUIa6Df/3cyedI1f1i uRSxAbO4lCKeOLUb/fVH3uF/gXaK4b8xByHLec4kajKFLrpgI9uTk5JgJGs2aaQuROI7Tldzd403I ba0KDkL5BYb1bIYIr6kLZ7iDywOLUYHsq4jTV4vu1ClMPWwP2D7MX6UowUu6I+NE6gePJnbSt1K0d n0fDiQAEw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn48g-0005Cf-6T; Wed, 09 Dec 2020 18:24:34 +0000 Received: from mail-wm1-x349.google.com ([2a00:1450:4864:20::349]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn48b-0005AA-0p for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 18:24:30 +0000 Received: by mail-wm1-x349.google.com with SMTP id b184so653699wmh.6 for ; Wed, 09 Dec 2020 10:24:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=sender:date:in-reply-to:message-id:mime-version:references:subject :from:to:cc; bh=V2rDh/PTRpe6NWZnEeAWnr3LbupuxXOheZwv6czKP7I=; b=sJrzjf+rsOdspdQKnYG9pg0y0KJCU2rf0QxkpTRnNcP3e6Aub3MH1asP3rLsM6Yq64 6sisT6KMQfH8oNrgEGWsXTZd3a3ZzfQwWKmo2YeftvCEs8fMbw2aspmzE5p531i4LWib 1VibozdtcpLde7sbMU6UwWyMSZ89dNKXMFuU8igBRvKCyjCCajbL1nH1Xjfeuq0wS6bN JOZE9p0wa5eM3Zr0LFT/S393AuaG2VtA5OsN7wa9eLZD46TKUlW2qLXWAuuXjEA/yxPZ Tlswk9BfFM5KF/UwXKuc/0LtX+iT/vGi4np7MS7nlxVqpQPKBSpyre6qGHsDxa5L2Nyg gaVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=V2rDh/PTRpe6NWZnEeAWnr3LbupuxXOheZwv6czKP7I=; b=iyyma/ouxEbphn3Iz9kWPjsw1l4GfQ7WQgXXciAauAUvtYsAE3G7q6bMlqKJwxJPgS GjUqrZtAsydjeakjinDOXbtHI3ThBLW6lGicX5nSJ6bu3ShuTMDV8+ne9QWhLJm7j9XC UpeOPJnjLaEzF53S3Z+UaMPxMKMRmMr2MBL/fi1nc7mrx3a/fwWmNK3WE1CTs5EC+59j Q4RNXOCiOyZplqH4kMHW8t6Km5gzmZWEmYtz7b45ow2i5GjSV+7apwxFbMJX79CGs2Bt h6V5tsF87XRlZ0RvglisIOFcCLWEFAylr/nARZzYNbes6hJfXU9xouDeT10XT++INfGN +L1g== X-Gm-Message-State: AOAM530Qg2p4nDKjVUWWJK/3pfArhTYsROIOYcw6B0vqzXh1q116g5/l w6FN/b4N7o5yjGiiqvBHi0PhpwnRGrM2CxQo X-Google-Smtp-Source: ABdhPJyP0L7+kNbjb687i7w1wzyg+YrLTPf+fehJ67MnVyUl7tP85xcGPS2oT8rxgT392YbT4bW+Ohr26jGwv8aY X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:adf:e710:: with SMTP id c16mr4123641wrm.295.1607538265727; Wed, 09 Dec 2020 10:24:25 -0800 (PST) Date: Wed, 9 Dec 2020 19:24:15 +0100 In-Reply-To: Message-Id: Mime-Version: 1.0 References: X-Mailer: git-send-email 2.29.2.576.ga3fc446d84-goog Subject: [PATCH mm 1/2] kasan: don't use read-only static keys From: Andrey Konovalov To: Andrew Morton X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_132429_089985_24B6D940 X-CRM114-Status: GOOD ( 13.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Marco Elver , Catalin Marinas , Kevin Brodsky , Will Deacon , Branislav Rankov , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Alexander Potapenko , Evgenii Stepanov , Andrey Konovalov , Andrey Ryabinin , Vincenzo Frascino , Dmitry Vyukov Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org __ro_after_init static keys are incompatible with usage in loadable kernel modules and cause crashes. Don't use those, use normal static keys. Signed-off-by: Andrey Konovalov Reviewed-by: Marco Elver --- This fix can be squashed into "kasan: add and integrate kasan boot parameters". --- mm/kasan/hw_tags.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c index c91f2c06ecb5..55bd6f09c70f 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -43,11 +43,11 @@ static enum kasan_arg_stacktrace kasan_arg_stacktrace __ro_after_init; static enum kasan_arg_fault kasan_arg_fault __ro_after_init; /* Whether KASAN is enabled at all. */ -DEFINE_STATIC_KEY_FALSE_RO(kasan_flag_enabled); +DEFINE_STATIC_KEY_FALSE(kasan_flag_enabled); EXPORT_SYMBOL(kasan_flag_enabled); /* Whether to collect alloc/free stack traces. */ -DEFINE_STATIC_KEY_FALSE_RO(kasan_flag_stacktrace); +DEFINE_STATIC_KEY_FALSE(kasan_flag_stacktrace); /* Whether panic or disable tag checking on fault. */ bool kasan_flag_panic __ro_after_init;