Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp309403pxm; Wed, 2 Mar 2022 16:02:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJzzAnBQfmuf7WVkA/GmTsEl1DyQcyymqkrh9OS/N6R72UrQea+VmuNnwmaxzaPZT9KpeKxn X-Received: by 2002:a05:6a00:3006:b0:4f6:54ba:3581 with SMTP id ay6-20020a056a00300600b004f654ba3581mr4798173pfb.83.1646265765238; Wed, 02 Mar 2022 16:02:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646265765; cv=none; d=google.com; s=arc-20160816; b=Q9G1gOaic625KFbkWXgZUMaIqmNCVJIOkADuXH2NDzgPSsBBQYjcvxleMU+6KrV4mq v1U/jZQZ6Fh+C/lbF+FPW/qfKoHLWlvNHch4wOySpvfkWAfUPh/RXiXqR39XC1ZLXekn 7U/4s6GEkW69zcP0VT2o+W5ZfofLL861wyzM4+fVBS4IqzuHYGP3TPUpUG9J9Jm7utlZ RnclJnGe8Lga3YzqSnaWL3AyV6pZnkpfoRZgPNwSBJiXlACtIWxQAYWk1ux+fme0ECvG JsjX2GNqxTSRKGdgf9jcG5oNtCclVhTyrpVGGzEG8UZ8nGs9zBoKHBN/qTWOjhX9IFtP EORg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=9LoFBOx+41NuRW+TN1sbV0xBqJ4TCv0zuyZEci6w9hM=; b=MjxSwQB0iIrttHVAWnZc25XBO2Ha916t/v89qDYyOMXEN1aViuvrDgOEuXHyfnsDa2 TmYWbWReV5uJ4yck3u1yuv/6DCMDe2FzJynOi4djzYmVmg9+BSOhsTe3DEkdS9vrApoA nAdnWjYEGWki6zthuLiopoeZtR/BhFanIooLUK++xDTq1N3k3EjJoO6HBr8c2zZ5cYhX 7bd+HF7Kov9g2WnhNc/7xt4DvOH1KPA/1NruWNKPUhSiKYAAFQKIy60yBH0yMz4K1hOJ lVmtyC7Jo3DtGVBL/8/1xbNholzZoaD2sjPeeBWKSq/9g1RI0s6JiD2/4wBL6zXmAEmn cJDQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=akh6ZCXA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id h6-20020a170902704600b0014fa4ebad07si460246plt.83.2022.03.02.16.02.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 16:02:45 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=akh6ZCXA; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5F2701A41D1; Wed, 2 Mar 2022 15:21:35 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240969AbiCBQj5 (ORCPT + 99 others); Wed, 2 Mar 2022 11:39:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239208AbiCBQjp (ORCPT ); Wed, 2 Mar 2022 11:39:45 -0500 Received: from out1.migadu.com (out1.migadu.com [91.121.223.63]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5CBE963BCB for ; Wed, 2 Mar 2022 08:39:01 -0800 (PST) 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=1646239139; 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: in-reply-to:in-reply-to:references:references; bh=9LoFBOx+41NuRW+TN1sbV0xBqJ4TCv0zuyZEci6w9hM=; b=akh6ZCXAq6FQiLjzz0h/T1o90vGgV7kP6AJdUAegzuJcUmFmx91g40h8iMe6ExZqRMVg8R 8vORXjnqmTNanqHasHPqrgDKVLA2b5UP/6An2XkkoipMm/2RQn3mf4ibXNC/PyVtnaQaIe NfFWVZDuiLbt7SARW7bRtOptFFXS3RE= From: andrey.konovalov@linux.dev To: Marco Elver , Alexander Potapenko Cc: Andrey Konovalov , Dmitry Vyukov , Andrey Ryabinin , kasan-dev@googlegroups.com, Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrey Konovalov Subject: [PATCH mm 16/22] kasan: move and simplify kasan_report_async Date: Wed, 2 Mar 2022 17:36:36 +0100 Message-Id: <52d942ef3ffd29bdfa225bbe8e327bc5bda7ab09.1646237226.git.andreyknvl@google.com> In-Reply-To: References: 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.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Place kasan_report_async() next to the other main reporting routines. Also simplify printed information. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 73348f83b813..162fd2d6209e 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -392,20 +392,6 @@ static bool report_enabled(void) return !test_and_set_bit(KASAN_BIT_REPORTED, &kasan_flags); } -#ifdef CONFIG_KASAN_HW_TAGS -void kasan_report_async(void) -{ - unsigned long flags; - - start_report(&flags, false); - pr_err("BUG: KASAN: invalid-access\n"); - pr_err("Asynchronous mode enabled: no access details available\n"); - pr_err("\n"); - dump_stack_lvl(KERN_ERR); - end_report(&flags, NULL); -} -#endif /* CONFIG_KASAN_HW_TAGS */ - static void print_report(struct kasan_access_info *info) { void *tagged_addr = info->access_addr; @@ -477,6 +463,20 @@ bool kasan_report(unsigned long addr, size_t size, bool is_write, return ret; } +#ifdef CONFIG_KASAN_HW_TAGS +void kasan_report_async(void) +{ + unsigned long flags; + + start_report(&flags, false); + pr_err("BUG: KASAN: invalid-access\n"); + pr_err("Asynchronous fault: no details available\n"); + pr_err("\n"); + dump_stack_lvl(KERN_ERR); + end_report(&flags, NULL); +} +#endif /* CONFIG_KASAN_HW_TAGS */ + #ifdef CONFIG_KASAN_INLINE /* * With CONFIG_KASAN_INLINE, accesses to bogus pointers (outside the high -- 2.25.1