From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5726BC433F5 for ; Fri, 22 Oct 2021 12:30:34 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 0EF9660F46 for ; Fri, 22 Oct 2021 12:30:34 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0EF9660F46 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:From:References:Cc:To: Subject:MIME-Version:Date:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=64gapf3TeqB65dZMHmOyGtJB9tWoyoLwcgygIV4E/fo=; b=MsbYJHx4bzpGCW wY9wGHG1fPO98zZl1EBmaZViP2qF86w3vZQi6/ZJDE1XFkQM+wGmS8meLHkCicCIqejeEP0Ldoa63 Y4B1M/ggxFBXXlQ60b76dKkHoflcc3uLR9m3KE21ho0Tjo99k7W6dBhhNGvNKAAGGG1cWjHb5hIuB hFGLW1FEWkZlrfRBHai/uIRNPePrrFYxlDIzNs2Wx0XDKP1DvqOI8wZd8EWD/wspX8PZtVfvpiYt5 GNCd175mpkQfVzJeRv7eLMvoq+CXiqueSHt6panwrkg31nkaf18+BsH2eB7xGRVJ1wKiBZcpNyb7I ribUt75462GAkGIhXcgA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdtfa-00Arqc-Bu; Fri, 22 Oct 2021 12:29:10 +0000 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mdtfV-00Arou-Gg for linux-arm-kernel@lists.infradead.org; Fri, 22 Oct 2021 12:29:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1634905743; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YuUgTaC7SncRn/56fPFHOc3RSrpIisjOLVPx5zTF8wM=; b=Yo0ReFKCg99uRbF4u3kCBENaSLKDOSZjw+mlsShssRvqRbBJ5BLohR3SKBlWL5y3vb8PIB GWqsBcijeRMC+fWvviFFpnK2m0fUxTbG24rTD2PidPExpqYAczvbtLkl3D5VtfMTS4NkQ2 1aNRveSe32j+I3eJw3NwVDwAFt1ikZI= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-455-w_ehpeGdObySOkM2qmqAqg-1; Fri, 22 Oct 2021 08:29:02 -0400 X-MC-Unique: w_ehpeGdObySOkM2qmqAqg-1 Received: by mail-wm1-f70.google.com with SMTP id c5-20020a05600c0ac500b0030dba7cafc9so956909wmr.5 for ; Fri, 22 Oct 2021 05:29:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:organization:in-reply-to :content-transfer-encoding; bh=YuUgTaC7SncRn/56fPFHOc3RSrpIisjOLVPx5zTF8wM=; b=yGptIiCQgJ4v7/NalPxljALKhVRPD/us/zjNgcQ9ZU4QTFTu/3nsGGCX5s0G88SxZf w7MGBhGcCUQ+fkG6PMpKb+gCwKsM6h6oUld9s5qgEsQzAziWHNS4H7SvnUFJGB++7Mwt aynmkJm2RVz/6lEun9qapWqJr4SEXDicgSfnwC0BxsQVR9WT60f122DeYh0F7isPJfe/ KoRTsJvHKC0tG+oj8t2UILLKDT2pNYksfEyyaPQWp4tpM/2JwFkRXFMm9c95VBH5gab2 ZZqWDI2mNWcggg5LzwjwlUk4RHHWAdb4d/xBARWoR3c5dmSf9cHzDcKEZ820FHzoktB/ qWGA== X-Gm-Message-State: AOAM531ODHkMEOjcPNRPTPw+8VDFfM+/lSvOiyIKZUrxwW+C2Fj0tgyR uQEVJrP4XXWncYiarE6buMLoIcLYGruFv4eX8K3NkkCjXfIdN57ay3eetu6+BSUoDlbOB8TwFn5 jaBrlk64Agq7B+M1KrR6+R/RLq7a760llK/0= X-Received: by 2002:adf:b355:: with SMTP id k21mr15307023wrd.380.1634905741163; Fri, 22 Oct 2021 05:29:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz8b0jvSBO/rDYlcgNKG5q+gpSX25bwLoicK9Z2PsuXIXbBKjkxBVkfERN2zEYyrkQpuyMqbA== X-Received: by 2002:adf:b355:: with SMTP id k21mr15306985wrd.380.1634905740893; Fri, 22 Oct 2021 05:29:00 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6324.dip0.t-ipconnect.de. [91.12.99.36]) by smtp.gmail.com with ESMTPSA id h14sm3553851wmq.34.2021.10.22.05.28.59 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 22 Oct 2021 05:29:00 -0700 (PDT) Message-ID: Date: Fri, 22 Oct 2021 14:28:59 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.0 Subject: Re: [PATCH v3] kasan: add kasan mode messages when kasan init To: Kuan-Ying Lee , Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Dmitry Vyukov , Catalin Marinas , Will Deacon , Andrew Morton , Matthias Brugger , Marco Elver Cc: chinwen.chang@mediatek.com, yee.lee@mediatek.com, nicholas.tang@mediatek.com, kasan-dev@googlegroups.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-mediatek@lists.infradead.org References: <20211020094850.4113-1-Kuan-Ying.Lee@mediatek.com> From: David Hildenbrand Organization: Red Hat In-Reply-To: <20211020094850.4113-1-Kuan-Ying.Lee@mediatek.com> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=david@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211022_052905_667982_E9FDAF68 X-CRM114-Status: GOOD ( 22.70 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 20.10.21 11:48, Kuan-Ying Lee wrote: > There are multiple kasan modes. It makes sense that we add some messages > to know which kasan mode is when booting up. see [1]. s/is/is active/ ? Looks reasonable to me Reviewed-by: David Hildenbrand > > Link: https://bugzilla.kernel.org/show_bug.cgi?id=212195 [1] > Signed-off-by: Kuan-Ying Lee > --- > v3: > - Rebase to linux-next > - Move kasan_mode_info() into hw_tags.c > v2: > - Rebase to linux-next > - HW-tag based mode need to consider asymm mode > - Thanks Marco's suggestion > > arch/arm64/mm/kasan_init.c | 2 +- > mm/kasan/hw_tags.c | 14 +++++++++++++- > mm/kasan/sw_tags.c | 2 +- > 3 files changed, 15 insertions(+), 3 deletions(-) > > diff --git a/arch/arm64/mm/kasan_init.c b/arch/arm64/mm/kasan_init.c > index 5b996ca4d996..6f5a6fe8edd7 100644 > --- a/arch/arm64/mm/kasan_init.c > +++ b/arch/arm64/mm/kasan_init.c > @@ -309,7 +309,7 @@ void __init kasan_init(void) > kasan_init_depth(); > #if defined(CONFIG_KASAN_GENERIC) > /* CONFIG_KASAN_SW_TAGS also requires kasan_init_sw_tags(). */ > - pr_info("KernelAddressSanitizer initialized\n"); > + pr_info("KernelAddressSanitizer initialized (generic)\n"); > #endif > } > > diff --git a/mm/kasan/hw_tags.c b/mm/kasan/hw_tags.c > index dc892119e88f..7355cb534e4f 100644 > --- a/mm/kasan/hw_tags.c > +++ b/mm/kasan/hw_tags.c > @@ -106,6 +106,16 @@ static int __init early_kasan_flag_stacktrace(char *arg) > } > early_param("kasan.stacktrace", early_kasan_flag_stacktrace); > > +static inline const char *kasan_mode_info(void) > +{ > + if (kasan_mode == KASAN_MODE_ASYNC) > + return "async"; > + else if (kasan_mode == KASAN_MODE_ASYMM) > + return "asymm"; > + else > + return "sync"; > +} > + > /* kasan_init_hw_tags_cpu() is called for each CPU. */ > void kasan_init_hw_tags_cpu(void) > { > @@ -177,7 +187,9 @@ void __init kasan_init_hw_tags(void) > break; > } > > - pr_info("KernelAddressSanitizer initialized\n"); > + pr_info("KernelAddressSanitizer initialized (hw-tags, mode=%s, stacktrace=%s)\n", > + kasan_mode_info(), > + kasan_stack_collection_enabled() ? "on" : "off"); > } > > void kasan_alloc_pages(struct page *page, unsigned int order, gfp_t flags) > diff --git a/mm/kasan/sw_tags.c b/mm/kasan/sw_tags.c > index bd3f540feb47..77f13f391b57 100644 > --- a/mm/kasan/sw_tags.c > +++ b/mm/kasan/sw_tags.c > @@ -42,7 +42,7 @@ void __init kasan_init_sw_tags(void) > for_each_possible_cpu(cpu) > per_cpu(prng_state, cpu) = (u32)get_cycles(); > > - pr_info("KernelAddressSanitizer initialized\n"); > + pr_info("KernelAddressSanitizer initialized (sw-tags)\n"); > } > > /* > -- Thanks, David / dhildenb _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel