Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp253653pxm; Wed, 2 Mar 2022 14:40:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKS6Ljb56l3xHQ8YbFY/znvaKRa8OsNybMjAxHbfU2gw1j1HfpYLh88YoYZ2pVxC/Ubggw X-Received: by 2002:a63:cd02:0:b0:378:9b24:4a9 with SMTP id i2-20020a63cd02000000b003789b2404a9mr15001236pgg.327.1646260815108; Wed, 02 Mar 2022 14:40:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646260815; cv=none; d=google.com; s=arc-20160816; b=djuMTOq/9bbWSFuxY6UOUNShjHRGhEA1x2aEVlZ9iNJ53uKL8S263ycvleFgv2PNtP cclNCAfwHX18MdKUIoc+9N4udKqQmaiF+gvtvUs5ECS/Xmr9vUyTibGkY2tdz2bfj4wv eTLRqv80koJ4GSp0KMd0iBt1MTyaJedZNpz9eAruxszKXHXZGjC2Z+VbaiGasYb0QDOO Nbx0e0CDCHIcc71CWyBuLFIGrOOlZwIi2Ml5KGHb1yocngWbtVgtqBuxCgOMwdMYT4X/ 9+dO0I3RaukUeJ5dDKkqQ3FTxcprDVMNTHerYnKEESnj4+nd2UDqWmZ+qBmGPRswxKjf /gIA== 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=I05J+o+7HT6Q0jFo6xpWdgjFaYldkohtghm32sfnKb0=; b=HJauQlB9cK6rYzL8JYTtdc1W4r9DyZT98GA3LPpPU0AM3D/VgwGxKIE0XyJnr3aVQD rLDhO3zXJq3eo8rlB4SaBcFUWzfRkClm4q0iCaTFc4oT5nmlAeBSc7wIhiFsx/7Mv825 pSwGKwZ21M9VHUqe7WKvNxbSbloRI1f2zijF7WQdHeTBdSQfp1c1/tmY5LjyGamEHWVE OFkkv5ZrfLLwHB12lC4Whs4Qm8BpiEDbOW8ZiMS8PYDfz6+ZEwCyEt0UdvGUNc7UeTcU QMvj3dO1OK8GV2KRxd6BszQI9TWv4qg3rq1JKKUpQZeO718VD1rVRGDF88iM9eSJOQpB YSww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=EoZSAVxP; 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 s14-20020a63924e000000b00370246ab5e6si321765pgn.522.2022.03.02.14.40.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Mar 2022 14:40:15 -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=EoZSAVxP; 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 0E369FE405; Wed, 2 Mar 2022 14:36:01 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239793AbiCBQii (ORCPT + 99 others); Wed, 2 Mar 2022 11:38:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236687AbiCBQih (ORCPT ); Wed, 2 Mar 2022 11:38:37 -0500 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F18A2C66B for ; Wed, 2 Mar 2022 08:37:53 -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=1646239072; 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=I05J+o+7HT6Q0jFo6xpWdgjFaYldkohtghm32sfnKb0=; b=EoZSAVxP43kd9ROACbNMePuzm1dcn+XXaWMyw5ByZ/ttIEznjWnvjbWO0dH1GvTwB4McX2 /2JSo4+MY3aZM3Dozy0YXIjTDH8PVgk+iIZXPfy/fkQnDliZIfQGZae3tuP+/dvC8GtBfz Mqgr+ukf08BswObNocR5H/yHe/qOgnw= 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 06/22] kasan: simplify async check in end_report Date: Wed, 2 Mar 2022 17:36:26 +0100 Message-Id: <1c8ce43f97300300e62c941181afa2eb738965c5.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 Currently, end_report() does not call trace_error_report_end() for bugs detected in either async or asymm mode (when kasan_async_fault_possible() returns true), as the address of the bad access might be unknown. However, for asymm mode, the address is known for faults triggered by read operations. Instead of using kasan_async_fault_possible(), simply check that the addr is not NULL when calling trace_error_report_end(). Signed-off-by: Andrey Konovalov --- mm/kasan/report.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/kasan/report.c b/mm/kasan/report.c index d60ee8b81e2b..2d892ec050be 100644 --- a/mm/kasan/report.c +++ b/mm/kasan/report.c @@ -112,7 +112,7 @@ static void start_report(unsigned long *flags) static void end_report(unsigned long *flags, unsigned long addr) { - if (!kasan_async_fault_possible()) + if (addr) trace_error_report_end(ERROR_DETECTOR_KASAN, addr); pr_err("==================================================================\n"); add_taint(TAINT_BAD_PAGE, LOCKDEP_NOW_UNRELIABLE); -- 2.25.1