Received: by 2002:a05:6a10:a841:0:0:0:0 with SMTP id d1csp555192pxy; Thu, 22 Apr 2021 08:10:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfIovoKRzg8OMhkvz9lCOtiasSUKnHlHmsT1aShjtYVn9SVAV8CTZVEjPrdp8NSythfpA9 X-Received: by 2002:a17:906:b01:: with SMTP id u1mr3993163ejg.310.1619104240512; Thu, 22 Apr 2021 08:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1619104240; cv=none; d=google.com; s=arc-20160816; b=EYWV+CPlvk9uFIbIi+yohONIAFgTNBKge97hR0gEC9W7Hy1MgjPTwBBgiehXxeB5zO IqUhOtu9U8/P3gpt4dA2EzYvPph6QpA0/UGJoNCyyM9PsNER7YkxE+sAM5AN0/j+gwqU dIRGfpFb/srOeQInd4cJrN3v1bTLT66f1y/VM1bHNuopkMY4jzyA7kL9ZXqTuTHAg80G LoHyNn8XgQ7nEWND8lWHdKWsxib9c6EG1CG6qyg5ddPHp03KuqGxE3xucuzZ8pRrqaOT 2IYpGQVId/G6F0wRjtrd/s8ADYGKcd3H3jp1Nu7OP+wlNwK7gnRfjoi2yCUIw3PRRHdv rebA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=aiWM9rp85vgyV36ASLFY/jLiQfSBITIqRxoGkPrE4Iw=; b=C+zKFWPBSvdgIoQZO5NudOCWz7k3znLCgVTs7I64k6+u9YLXLagck7mPiYrWSHvkAE NKrZ51C8ceU8EPGAKJPU8V7IMtbdPQa5Vp9GYJrGDyTuDsnEBHWp6D4Iq9rS7Hw+wx+/ vQ9bj8IL/PD5Pt+8jydH1y13jBZTkrjfGQAeKGcCpzihPNS+sEV1IQBVLcPmdaxJ7p3n bdhfN0odXwyI9mWONnLpPdmqoH/0xDZ6u6nO3NET+i1HNY6V9iN+wRLcg6BFf6oOGD26 +KQ8lMe8/9gLiCHRM/9tRqQJzVi61yGZo3O7WQjGo11/zXoN9Zk4YP5Erds97cLFraoc JgAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YwpW4PO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e23si176125edy.344.2021.04.22.08.10.15; Thu, 22 Apr 2021 08:10:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=YwpW4PO5; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237475AbhDVPHW (ORCPT + 99 others); Thu, 22 Apr 2021 11:07:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236547AbhDVPHV (ORCPT ); Thu, 22 Apr 2021 11:07:21 -0400 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B28ADC06174A for ; Thu, 22 Apr 2021 08:06:46 -0700 (PDT) Received: by mail-ed1-x52d.google.com with SMTP id z5so17378086edr.11 for ; Thu, 22 Apr 2021 08:06:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=aiWM9rp85vgyV36ASLFY/jLiQfSBITIqRxoGkPrE4Iw=; b=YwpW4PO5GfM7uc9mqvAfOC7AUhsP7CQug/ztxN73rTTEjyZz7CiKQbTaOsKDSWewRa mcwnVDJ+c9GxNh0/A8uETV8xX2JPc9nxP0JMXn9fTV0ZY69SLR69IL1rYAnCUJPthZH5 Zf45WuZ9PFYVUuaX5L1QG3FlcXh9Mj71Wwfxp1jv9JNny21QabQy5mBqPpEUcQ2/j8eI PKKMaybb0D9l6OxlBxjv9b8gsdGSSVLSschuRSkt1v7LEhUt7zg8Ll8sgLMAP43Pf1xp huDbO2xlAqR/7hDnNdCm0gLlQNmUBG0Fw1hKvb6QhRWifWA/Y9ndl4t6sjhfXZnfP9+S 34aQ== 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=aiWM9rp85vgyV36ASLFY/jLiQfSBITIqRxoGkPrE4Iw=; b=oNVNGhqs0fR8B8/oRsuHtDBolg1wCTq1yn3SkrPM+D757fZZmsR4pte+hHOuj5WXP7 g5KhB5b6erckd8o/XhmHIEhFX63VngePf9vtqAFgUhErPmczpK3ceWEoUAYjx7uRYYoL tbKLk98G48EhkO9iCwmJMJjE/dB0buU6YIG4Tu4agkWKWSVtn8WokOr8faYktfLHjmQU smgHSwx1IBNmFRs44eRpjfZ1BYPAsbyH/Zs2GAnQMb4QIE99rHVO1sAO6kyLq0HH9OSE lpp+8vssJeecWXAM8mUOVNTc/3l78jQTWgqI+KTS4AmQSps8jPFMf0jl0xr7T5jB6X3m i0jg== X-Gm-Message-State: AOAM533ZslKa45Lryvphj6mRiQ/8hS6LAOAYl1zz/XT6M6HZ8g6G07MC pDP24S03WwrJ8u1JN7o3CQz7zFqgabGJ0IPlC7A= X-Received: by 2002:aa7:d541:: with SMTP id u1mr4497795edr.95.1619104005534; Thu, 22 Apr 2021 08:06:45 -0700 (PDT) MIME-Version: 1.0 References: <1619079317-1131-1-git-send-email-maninder1.s@samsung.com> In-Reply-To: From: Andrey Konovalov Date: Thu, 22 Apr 2021 17:06:34 +0200 Message-ID: Subject: Re: [PATCH 1/2] mm/kasan: avoid duplicate KASAN issues from reporting To: Marco Elver , Maninder Singh Cc: Andrey Ryabinin , Alexander Potapenko , Andrew Morton , Dmitry Vyukov , kasan-dev , Linux Memory Management List , LKML , a.sahrawat@samsung.com, Vaneet Narang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 22, 2021 at 4:10 PM Marco Elver wrote: > > 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. I agree with Marco here. It doesn't make sense to have this deduplication code in the kernel anyway. If you want unique reports, write a userspace script that parses dmesg and groups the reports. Thanks!