Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp182729pxu; Thu, 15 Oct 2020 00:49:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxRrYhddcoFH6mIiJYtk387ADEgMsBgDFmxsKhwgGjd7MUX1SGh+GkA5LSOccX0wECVHLnk X-Received: by 2002:a50:85c6:: with SMTP id q6mr3111227edh.126.1602748154222; Thu, 15 Oct 2020 00:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602748154; cv=none; d=google.com; s=arc-20160816; b=WduLEABRmXWyuFCiEJG2/BmBAURwTsEWGI8lnOVf/7uERSCUIyo1v6vdViVYOKLL/T 2ZPEWv4glnb1s99HjXw6/6iOeZRZRAMzIw/pn2Myl7PLdHJ4rQnAczJAqJQcqtt+e/Xl ItWFqxQpEtr9J/VvKTwcyH4hsdAVMxtbTKPj35HVo2MJQitdcWV97xqfnFXTeK2VxDZ/ P7+zJ0MOaL28ZcpnWTkOESC5f6DY/SyRcqBGAuzzbvJSU8tL1WweoQHS9ljnZkQCDbk0 CKZg6FzV/H4eS9YW+EhqWdw9SdNmA0gtQ5SswCY/LwoCr2qsG42DZ5ZjEzom6ErfoH8l aC5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:references:mime-version :message-id:in-reply-to:date:sender:dkim-signature; bh=K2o7M+jwCbfe3UtigR/EtRx8zIOq967XZxvWYmUAylE=; b=bigxTtyF55RLN2cNHtd5vHOWBTKe7sWSot21UYtWU9q1u75UOQydIMTvmH6lBw57aS 3hVC3pWuxKaZibGnQHvAx4mKE45RHxUqZw5etZVQcz5Qsv8A9ZAjwtodnyjKafSVSQhd uymfygCnEnmccmxXHBzdURtXBJg35ewhiT3MPDDaHGZEKtVdfUIM80i7dOuJKglIHKa/ Zg7SpCwifwsV6yIBMHKVFiZ7ujcb5reLnEmUEdffXDg4MnBhzFeSfYY2bZUvnk+hLOZV NT1ybLdFmLV/iF83b6A9vdDm8aMh6ihHY+3/TmhCgasfw7pJQLQfxmyUBXENE4N2CAkb NeKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hb9Kmil4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x26si1631758ejc.582.2020.10.15.00.48.52; Thu, 15 Oct 2020 00:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=Hb9Kmil4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389079AbgJNUpH (ORCPT + 99 others); Wed, 14 Oct 2020 16:45:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33724 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388200AbgJNUpA (ORCPT ); Wed, 14 Oct 2020 16:45:00 -0400 Received: from mail-wr1-x44a.google.com (mail-wr1-x44a.google.com [IPv6:2a00:1450:4864:20::44a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DEA62C061755 for ; Wed, 14 Oct 2020 13:44:59 -0700 (PDT) Received: by mail-wr1-x44a.google.com with SMTP id r8so256793wrp.5 for ; Wed, 14 Oct 2020 13:44:59 -0700 (PDT) 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=K2o7M+jwCbfe3UtigR/EtRx8zIOq967XZxvWYmUAylE=; b=Hb9Kmil4v2SRhfkLDhDTagXl/nUN+fP8O3bsS45+El5zffAxebkKT6UVz7yTdYw86B alBCvfMBfSlR/6368v5eeWKz7rNvS2N/tnxS+BLZfPMaKeK8AS1fmRI2uaZhQStUIydF +1F141nJhz+yIg4AE1xMg6goNYuw6TDadDeAkQuvlrc0LfUWkUchqQJDEDV5VLsRWDHJ KumZSGP9LGAPAcAcWgec5zOHknwtaFEiS4Xbdmyf2O+nOlfzicZP88Sypn4sryTN5pep lBjrz7hUrlJ0Rosjc/tA7JyQ5yJh4nVtqsH5VMzpuFtjXv26a6Ba9NR3vZaUX+bXuafb IzNg== 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=K2o7M+jwCbfe3UtigR/EtRx8zIOq967XZxvWYmUAylE=; b=ZRihSl1+u1fSR6bC1ILOZoO0+6h3fnFMzvinLBsIDXaKSp8TdnAvWofRImAt20bikX RIrb8eD/LRevI9113EOyaZvEhtOUrORQlnl3pBEw9pitiBRAxrIyhvDkIgDMn+Zq6BdG a+QMTSc2sVu3RTF7mv8/77PCyv276JOtzkIjs/gxzHBwcxoZNx1/jYjF78khEhl2K5SK Y1UQjqa5XKhxa/bVRP/oXFcu9Zcx0f5ucmg5HmMns/ftecrdXifkmKDSX+tB+9H6by6f JJNgLbNKHF71sKxiHtEk/1e7bgc4wLC2JR4Vb69pUpy4UZySgkG111ch2gcpMX5qXJOr sVwQ== X-Gm-Message-State: AOAM532aiHFHiEF6RYsqYPlLKGUffozfoSCIGSLdWf7l2TXKpIRkDYMy 1hTjJMNEJhEHc60HRnANha18FTcnn/6LdO1e Sender: "andreyknvl via sendgmr" X-Received: from andreyknvl3.muc.corp.google.com ([2a00:79e0:15:13:7220:84ff:fe09:7e9d]) (user=andreyknvl job=sendgmr) by 2002:a1c:e1d7:: with SMTP id y206mr622854wmg.48.1602708298576; Wed, 14 Oct 2020 13:44:58 -0700 (PDT) Date: Wed, 14 Oct 2020 22:44:34 +0200 In-Reply-To: Message-Id: <4e018edd628802e8454e80fb308e220e1ce2113a.1602708025.git.andreyknvl@google.com> Mime-Version: 1.0 References: X-Mailer: git-send-email 2.28.0.1011.ga647a8990f-goog Subject: [PATCH RFC 6/8] kasan, arm64: move initialization message From: Andrey Konovalov To: Catalin Marinas , Will Deacon , Vincenzo Frascino , Dmitry Vyukov , Alexander Potapenko , Marco Elver , Evgenii Stepanov Cc: Andrey Ryabinin , Elena Petrova , Branislav Rankov , Kevin Brodsky , Andrew Morton , kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tag-based KASAN modes are initialized with kasan_init_tags() instead of kasan_init() for the generic mode. Move the initialization message for tag-based modes into kasan_init_tags(). Also fix pr_fmt() usage for KASAN code: generic mode doesn't need it, tag-based modes should use "kasan:" instead of KBUILD_MODNAME. Signed-off-by: Andrey Konovalov Link: https://linux-review.googlesource.com/id/Idfd1e50625ffdf42dfc3dbf7455b11bd200a0a49 --- arch/arm64/mm/kasan_init.c | 3 +++ mm/kasan/generic.c | 2 -- mm/kasan/hw_tags.c | 4 ++++ mm/kasan/sw_tags.c | 4 +++- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c index b6b9d55bb72e..8f17fa834b62 100644 --- a/arch/arm64/mm/kasan_init.c +++ b/arch/arm64/mm/kasan_init.c @@ -290,5 +290,8 @@ void __init kasan_init(void) { kasan_init_shadow(); kasan_init_depth(); +#if defined(CONFIG_KASAN_GENERIC) + /* CONFIG_KASAN_SW/HW_TAGS also requires kasan_init_tags(). */ pr_info("KernelAddressSanitizer initialized\n"); +#endif } diff --git a/mm/kasan/generic.c b/mm/kasan/generic.c index de6b3f03a023..d259e4c3aefd 100644 --- a/mm/kasan/generic.c +++ b/mm/kasan/generic.c @@ -9,8 +9,6 @@ * Andrey Konovalov */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt - #include #include #include diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c index 0128062320d5..b372421258c8 100644 --- a/mm/kasan/hw_tags.c +++ b/mm/kasan/hw_tags.c @@ -6,6 +6,8 @@ * Author: Andrey Konovalov */ +#define pr_fmt(fmt) "kasan: " fmt + #include #include #include @@ -18,6 +20,8 @@ void __init kasan_init_tags(void) { init_tags(KASAN_TAG_MAX); + + pr_info("KernelAddressSanitizer initialized\n"); } void *kasan_reset_tag(const void *addr) diff --git a/mm/kasan/sw_tags.c b/mm/kasan/sw_tags.c index bf1422282bb5..099af6dc8f7e 100644 --- a/mm/kasan/sw_tags.c +++ b/mm/kasan/sw_tags.c @@ -6,7 +6,7 @@ * Author: Andrey Konovalov */ -#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt +#define pr_fmt(fmt) "kasan: " fmt #include #include @@ -41,6 +41,8 @@ void __init kasan_init_tags(void) for_each_possible_cpu(cpu) per_cpu(prng_state, cpu) = (u32)get_cycles(); + + pr_info("KernelAddressSanitizer initialized\n"); } /* -- 2.28.0.1011.ga647a8990f-goog