From patchwork Fri Mar 25 01:12:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12791182 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3EFC6C433EF for ; Fri, 25 Mar 2022 01:12:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB0708D0028; Thu, 24 Mar 2022 21:12:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C14308D0005; Thu, 24 Mar 2022 21:12:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AB4868D0028; Thu, 24 Mar 2022 21:12:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0211.hostedemail.com [216.40.44.211]) by kanga.kvack.org (Postfix) with ESMTP id 9BAC68D0005 for ; Thu, 24 Mar 2022 21:12:42 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5A2B11828EE04 for ; Fri, 25 Mar 2022 01:12:42 +0000 (UTC) X-FDA: 79281133764.22.A8E24EB Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf19.hostedemail.com (Postfix) with ESMTP id DEE411A0030 for ; Fri, 25 Mar 2022 01:12:41 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5363561857; Fri, 25 Mar 2022 01:12:41 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1831EC340F1; Fri, 25 Mar 2022 01:12:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1648170761; bh=uuruo3c0c9pP7nGlc+DL3nYoqS/l/82NjfW3WXzMNWo=; h=Date:To:From:In-Reply-To:Subject:From; b=e24uEqeGCewNwUFmIWHRHWgJ1GIwfjIAyggZaTSBB4fgxO52NFk+sik7RCFp1qpRW 7g2D0jGDuS6ZpPXrlt0injTh1HgWsakoBNh2fxEfB6wOn1fwNr2x0MVzgkjs7tROpu 4gfCcWETMnruqHdsGD3SOvvLy6siKXGhMN64giys= Date: Thu, 24 Mar 2022 18:12:40 -0700 To: ryabinin.a.a@gmail.com,glider@google.com,elver@google.com,dvyukov@google.com,andreyknvl@google.com,akpm@linux-foundation.org,patches@lists.linux.dev,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220324180758.96b1ac7e17675d6bc474485e@linux-foundation.org> Subject: [patch 082/114] kasan: move disable_trace_on_warning to start_report Message-Id: <20220325011241.1831EC340F1@smtp.kernel.org> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DEE411A0030 X-Rspam-User: Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=e24uEqeG; dmarc=none; spf=pass (imf19.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Stat-Signature: gqs4w7ma1wn1x7qrdrdzraf3me3ckco8 X-HE-Tag: 1648170761-382265 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Konovalov Subject: kasan: move disable_trace_on_warning to start_report Move the disable_trace_on_warning() call, which enables the /proc/sys/kernel/traceoff_on_warning interface for KASAN bugs, to start_report(), so that it functions for all types of KASAN reports. Link: https://lkml.kernel.org/r/7c066c5de26234ad2cebdd931adfe437f8a95d58.1646237226.git.andreyknvl@google.com Signed-off-by: Andrey Konovalov Reviewed-by: Alexander Potapenko Cc: Andrey Ryabinin Cc: Dmitry Vyukov Cc: Marco Elver Signed-off-by: Andrew Morton --- mm/kasan/report.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- a/mm/kasan/report.c~kasan-move-disable_trace_on_warning-to-start_report +++ a/mm/kasan/report.c @@ -129,6 +129,8 @@ static DEFINE_SPINLOCK(report_lock); static void start_report(unsigned long *flags, bool sync) { + /* Respect the /proc/sys/kernel/traceoff_on_warning interface. */ + disable_trace_on_warning(); /* Update status of the currently running KASAN test. */ update_kunit_status(sync); /* Make sure we don't end up in loop. */ @@ -421,7 +423,6 @@ static void __kasan_report(unsigned long void *untagged_addr; unsigned long flags; - disable_trace_on_warning(); start_report(&flags, true); tagged_addr = (void *)addr;