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 X-Spam-Level: X-Spam-Status: No, score=-13.3 required=3.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 378F8C433B4 for ; Thu, 22 Apr 2021 14:10:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9BD5761404 for ; Thu, 22 Apr 2021 14:10:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9BD5761404 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B6ABD6B006C; Thu, 22 Apr 2021 10:10:50 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AF3CA6B006E; Thu, 22 Apr 2021 10:10:50 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9471B6B0070; Thu, 22 Apr 2021 10:10:50 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0125.hostedemail.com [216.40.44.125]) by kanga.kvack.org (Postfix) with ESMTP id 73E6A6B006C for ; Thu, 22 Apr 2021 10:10:50 -0400 (EDT) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 31DB01F1A for ; Thu, 22 Apr 2021 14:10:50 +0000 (UTC) X-FDA: 78060189060.10.D57C854 Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) by imf29.hostedemail.com (Postfix) with ESMTP id F01373DA for ; Thu, 22 Apr 2021 14:10:46 +0000 (UTC) Received: by mail-oi1-f172.google.com with SMTP id l17so14589738oil.11 for ; Thu, 22 Apr 2021 07:10:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=600yFqdvLD6QPDeXvLbZtVFaRxpf+lbCpMUSy9z+aew=; b=l0At3nLZ1t+yqC//2RYbMYuu11jD3AJPgV2m+fCvGiTGSloUt+jiPiiVetXXYXYnj2 D4dlqS/3mYmyxrJtAnVZreuk1X83dnHn0VV/BIQ5E85XIDErxPO9g/jGqJN1Ct1JG3xL 7wox/dvT+hI6sc9ta5DvUzT0cTbbrCb3458UA3yzCMLTr73STov7KKXtDmRcUFtdW1ZR j/j0izHpcnxxUoXuz/V/kVhYWNTAxVRv6a4Bn/6vv0YZVL2bJZ/TRN3S4ena8pJa843s xaGV72FyWORcIV6HpQTI50k7RSgNFBvrk7Lh+wcZbNfvIeN7bStml3ZkKXx1Y7QjvHUb 6Yvg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=600yFqdvLD6QPDeXvLbZtVFaRxpf+lbCpMUSy9z+aew=; b=o2UVEy0gsmuIrIL1ha9iaiwKv2QBLYfzSiiqlhuCyja+AzkL7I6t1pqnn4jVheO7eD KGFW6MWAy+pubZC7N096kcTSOxgX6yotXTIB1rnAqpi+qTA2IrIy0UKvFR1SQ8e40ohh 1r5eLWiV4MqCl0Gzsmzs/oQwQbPaovyOB3cTd2SBNbfjKTGxWETbeo8f7+h2RFk4wSTy /SyNQLsOnZyr4uuqHZgJY0aaW7qR+NfUhLHtSa7Fv08hoV6raKlaUyOj6A70M2Kv3iTB kulC+kiBznS6UzIdZyV2wZTDoOn/dpXMMYSBC3RMFFBP9y8FgcAQvO8QLqFeeZEWALEY 9TvA== X-Gm-Message-State: AOAM531ZTwHermY8ul+Rm29PUap7d9KmJ+PSJ868LLR4uEzr+O/8xRH4 64rpRcbza7rLVNaxk3EZpCrboVSGPQCc0S5A8vgQlA== X-Google-Smtp-Source: ABdhPJzLqfWX/hkWVpkfSOPUWXCJQ76VlJkSCdMWODVYg3w/XYdzkxR48j5tAkftxScDWQ40rQSlAatrGtreiVwrv5E= X-Received: by 2002:aca:bb06:: with SMTP id l6mr2377466oif.121.1619100648941; Thu, 22 Apr 2021 07:10:48 -0700 (PDT) MIME-Version: 1.0 References: <1619079317-1131-1-git-send-email-maninder1.s@samsung.com> In-Reply-To: <1619079317-1131-1-git-send-email-maninder1.s@samsung.com> From: Marco Elver Date: Thu, 22 Apr 2021 16:10:37 +0200 Message-ID: Subject: Re: [PATCH 1/2] mm/kasan: avoid duplicate KASAN issues from reporting To: Maninder Singh Cc: Andrey Ryabinin , Alexander Potapenko , Andrey Konovalov , Andrew Morton , Dmitry Vyukov , kasan-dev , Linux Memory Management List , LKML , a.sahrawat@samsung.com, Vaneet Narang Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: F01373DA X-Stat-Signature: ghwcwczpd6omqxbuerc7yf13ceibo5zp Received-SPF: none (google.com>: No applicable sender policy available) receiver=imf29; identity=mailfrom; envelope-from=""; helo=mail-oi1-f172.google.com; client-ip=209.85.167.172 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1619100646-28963 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: On Thu, 22 Apr 2021 at 11:17, Maninder Singh wrote: > > when KASAN multishot is ON and some buggy code hits same code path > of KASAN issue repetetively, it can flood logs on console. > > Check for allocaton, free and backtrace path at time of KASAN error, > if these are same then it is duplicate error and avoid these prints > from KASAN. On a more fundamental level, I think this sort of filtering is the wrong solution to your problem. One reason why it's good that multishot is off by default is, because _every_ KASAN report is critical and can destabilize the system. Therefore, any report after the first one might be completely bogus, because the system is in a potentially bad state and its behaviour might be completely random. The correct solution is to not leave the system running, fix the first bug found, continue; rinse and repeat. Therefore, this patch adds a lot of code for little benefit. The much simpler solution that will likely yield a similar result is to simply define an upper bound on the number of reports if multishot is on. Because if I've seen 1000 reports, I already know the system is completely trashed and whatever else it's reporting might just be random. Thanks, -- Marco