Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp181361pxm; Wed, 2 Mar 2022 12:59:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJy1Q0zxsO6VSImHT/l+8y0iK0fqeJ/Ijto3Py6sWKACzRiA1N3xMUR6SW5jLyXqsh4F2RVD X-Received: by 2002:a17:90a:cc6:b0:1bc:e556:e6ae with SMTP id 6-20020a17090a0cc600b001bce556e6aemr1699091pjt.28.1646254793627; Wed, 02 Mar 2022 12:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646254793; cv=none; d=google.com; s=arc-20160816; b=xCc3Gtfe9hFcXeCghc9rDsEhl6wthnA0LBTCp2S8Rnfr0LkmuU+R5FpGNIEfdGhQJ1 a2NCB8SQJ3Bx8h7hQ1MBlql1GVTJPR5uIk+2edgomvXqBFWeRR7W6SOV2jgfVIByXOuF IdS5vI3pocHCdIGz3QjVnHlgKw5Q+WxL1EkhGmW5QmUT6Aks0l6bDne7tKk1jeMrByhx eedi2oYKhmbHPxiIOW28rukpjy/UtKYgwq3AQgJ14/9TCM0B/7DvKXsJ9a8/kfQCH2cd eaHeSBk9SWfZgLX4WGxSF3CozQWQYF/xIkPJjLcwFTsrb2NzltLKETdgy+oujtEORi9H 6uag== 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=4cKKYZ6rFTNdllIAOfnpLukoRzeAYo94WNiwHmUVtvE=; b=XbckKIzFDt2G8iy+/BgFEjfC4g6hbyDgHk2EnohnvcWssxfeolfpO/NHLF+9lJR08Z d6WlujLUrarVRUgv/IMSz1Vqtq8BOrLAAZQpR5/BiWI0JV/k17zrYafKDPb8df2HQ5xV 6njWLYcKcJ/a/5n1dpGNxeQbz4SPvgHN3dzoBCpAalcYcK3T02/S8jbIl1wc4Q+7PlWc ppm2hmGl20/shqwtfPlCdzcezdFR0gTkRrm4uoKqTxTfHfQ5rsHujn90pF/2OUWdB3RU DCvk0ojOEXrR5Sfj2uB304hMns5LLJn4R0aZbTKkFEWLl8gee9y4oTggm8ex1srIrsyo QhSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HVbToheI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fh2-20020a17090b034200b001b97e6dd95csi6275584pjb.1.2022.03.02.12.59.36; Wed, 02 Mar 2022 12:59:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=HVbToheI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243128AbiCBQiw (ORCPT + 99 others); Wed, 2 Mar 2022 11:38:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242974AbiCBQij (ORCPT ); Wed, 2 Mar 2022 11:38:39 -0500 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2A1792C66B for ; Wed, 2 Mar 2022 08:37:56 -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=1646239074; 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=4cKKYZ6rFTNdllIAOfnpLukoRzeAYo94WNiwHmUVtvE=; b=HVbToheIxR10VUP8ZlBKwBpe96+cP7ZagHwjrCt0/PJTSNJAVAmgv4JjI3toxGepTU/P+x kxBUHAO6r9T8Ca7DmIdW5ZyIoqecbSNt8eWrMkNdaBe81yZJigAWXY2dR1/2QfOthDk1I+ EZlcs8NWhHuUPzVWc6JhOYmxDyHVn4U= 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 10/22] kasan: move disable_trace_on_warning to start_report Date: Wed, 2 Mar 2022 17:36:30 +0100 Message-Id: <7c066c5de26234ad2cebdd931adfe437f8a95d58.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.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham 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 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. Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index 0b6c8a14f0ea..9286ff6ae1a7 100644 --- a/mm/kasan/report.c +++ b/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 addr, size_t size, bool is_write, void *untagged_addr; unsigned long flags; - disable_trace_on_warning(); start_report(&flags, true); tagged_addr = (void *)addr; -- 2.25.1