Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2103028pxa; Mon, 17 Aug 2020 00:14:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxP8s4MHK0Db0Vse8OaC+kZWt4kMrKMEmNzpiLlX8meji4QntSacb0RF2mbr32ZhLO2ioez X-Received: by 2002:a50:fb10:: with SMTP id d16mr13826346edq.134.1597648446360; Mon, 17 Aug 2020 00:14:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597648446; cv=none; d=google.com; s=arc-20160816; b=b2KXd4YVfT4n7xLfG5CBKWzaT5XCD+SdPmC5x2WA4B4bKAd5p2w+D2b3oRyu/nmiXz VIv37oWY/dx9jZnL/T8cspdauRQ9dxBoLzrRJ5zqWW6fJULK/fKwW/snnFnBdjQpLC/8 aa+PkhuQHicEgayisn8HLSAYwgHoao4ZKBW6Tkja+J36DuRj5LY0c+pQ+gYa4V0zN3m1 7WSwiDvrAlyzXKXNuhkBUb3+PtaoEg97I3OcvPN8f61lsRJ8o4mKOYRbRyfi/wA2kLu3 akUTFHda8ns4QLeDfxanpU3Bp9yDSb06kyZGiDnlimJQlYzT5vo+fQFS07gAjs37ux0Q vN7g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=Yjoi260yivvP8E6VWrtmP+N5ypeCnjjZyP0aQQnqe/M=; b=iQSD4J1hvbM7DLl0cvGj3tqaJr7DH6uscAPOIgwiRRqj31+EzY8fJay4YovyG6F2uO kCCiWSCsxdSDEG+XdHhsmpKkqYomJnQA1JDYPdlvEqMbA8YMUr5lnRAT0ENU1Xi5EWmY TtvhmtQcavg0Qm/j+z4UNoZF+Pat3WnFX5WaZ/Hkvf/HuXvi3jI8rZu6/z66i02yUEEB pwREEYL1PgL2q1qxCPetoX1LDmTayssB+jQFdcYUmlXX0nOT4KyVVuBQJFYmXw6/DWyn 8CLzdvRf8jRp9XvlmnDn80zqsnA3zzRxQRPuh1cevOuR2jlhBKp+QqqATxgvrRykBC+S Vh8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=OhMuhXoT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j11si10457026edq.584.2020.08.17.00.13.43; Mon, 17 Aug 2020 00:14:06 -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=@google.com header.s=20161025 header.b=OhMuhXoT; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726265AbgHQHKu (ORCPT + 99 others); Mon, 17 Aug 2020 03:10:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40950 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725765AbgHQHKr (ORCPT ); Mon, 17 Aug 2020 03:10:47 -0400 Received: from mail-oi1-x243.google.com (mail-oi1-x243.google.com [IPv6:2607:f8b0:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E311EC061388 for ; Mon, 17 Aug 2020 00:10:46 -0700 (PDT) Received: by mail-oi1-x243.google.com with SMTP id l204so13974899oib.3 for ; Mon, 17 Aug 2020 00:10:46 -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=Yjoi260yivvP8E6VWrtmP+N5ypeCnjjZyP0aQQnqe/M=; b=OhMuhXoTQ8sDuP2VzfqpdbjlOHEj2dXmR8dEiSEBWTL2GfPjIGBRLuFtA1Z5CbwOfz xxSi5QjyDz1zuz+NVO7M3hLBjTlUn7N47KbczSAr3HzvR5uP5adz/5tTPt1djhfj7bGa URyv+LzO/KA/mihbRAWKJz76MzcNODlK/X1BN0OkxdhCEwN02P5ygU/ARzs73bFr9VpV mqI6aCS7HVyb6X9LKY+NAU7sTUl0nL1viANnYejE4Z/qQzv3n/i2KhuJQCgXG6oMQH7X uppDOlFl/krlzy4jVxU2TZaTcfv6d5EkkMqus9kw6WyPURbzhEIvHqM+JMz+gx5RC0tk J14g== 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=Yjoi260yivvP8E6VWrtmP+N5ypeCnjjZyP0aQQnqe/M=; b=Kbbhv6rE9PQrPAfBbzI1eQ1LmyEgYWgUpJNZeEaiSaR0j2pdrdHdSXB61sVCqIecXj /Gu0MotrTV4OH3+pDvV2re0kNknfAN/ATmEwW/VzMYY7D4c8CjauFdHm9Quyb4ImNFPl +MdTO5rFYgJ5qf0iz6EL67pbL7Mv9DHvIHCQtfxfefQCSxsNHi/iJ12SX7mfWLgufbfg z9JJBfbYYixeEdZxzmHGPik4uKDggPOO9cFGm8IT+gfGe+NDK/HaLLlc1JnJKjgq/JEY fQB4g1qjZ9bCZKeUq8PV6XvFT8d4WC7D4xIyZdCe5SdT/AQ1hybzqiF534ucbOa/bRG2 0TwQ== X-Gm-Message-State: AOAM532ngS8al3F6q9YA0HpQzKepvQdUrLWirdTZGcHuA0kZwO5rRLAp wLwwukadp8JSStbcoJ8EtfsJw0+6MXgJ1W7ZQZU6cQ== X-Received: by 2002:aca:aa8c:: with SMTP id t134mr8082078oie.121.1597648243722; Mon, 17 Aug 2020 00:10:43 -0700 (PDT) MIME-Version: 1.0 References: <20200807090031.3506555-1-elver@google.com> <87pn7yxnjc.fsf@nanos> In-Reply-To: From: Marco Elver Date: Mon, 17 Aug 2020 09:10:32 +0200 Message-ID: Subject: Re: [PATCH] kcsan: Treat runtime as NMI-like with interrupt tracing To: Thomas Gleixner Cc: "Paul E. McKenney" , Peter Zijlstra , Borislav Petkov , Ingo Molnar , Mark Rutland , Dmitry Vyukov , Alexander Potapenko , Andrey Konovalov , kasan-dev , LKML , syzbot Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Aug 2020 at 08:56, Marco Elver wrote: > On Mon, 10 Aug 2020 at 22:18, Thomas Gleixner wrote: > > Marco Elver writes: > > > Since KCSAN instrumentation is everywhere, we need to treat the hooks > > > NMI-like for interrupt tracing. In order to present an as 'normal' as > > > possible context to the code called by KCSAN when reporting errors, we > > > need to update the IRQ-tracing state. > > > > > > Tested: Several runs through kcsan-test with different configuration > > > (PROVE_LOCKING on/off), as well as hours of syzbot testing with the > > > original config that caught the problem (without CONFIG_PARAVIRT=y, > > > which appears to cause IRQ state tracking inconsistencies even when > > > KCSAN remains off, see Link). > > > > > > Link: https://lkml.kernel.org/r/0000000000007d3b2d05ac1c303e@google.com > > > Fixes: 248591f5d257 ("kcsan: Make KCSAN compatible with new IRQ state tracking") > > > Reported-by: syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com > > > Co-developed-by: Peter Zijlstra (Intel) > > > Signed-off-by: Marco Elver > > > --- > > > Patch Note: This patch applies to latest mainline. While current > > > mainline suffers from the above problem, the configs required to hit the > > > issue are likely not enabled too often (of course with PROVE_LOCKING on; > > > we hit it on syzbot though). It'll probably be wise to queue this as > > > normal on -rcu, just in case something is still off, given the > > > non-trivial nature of the issue. (If it should instead go to mainline > > > right now as a fix, I'd like some more test time on syzbot.) > > > > I'd rather stick it into mainline before -rc1. > > > > Reviewed-by: Thomas Gleixner > > Thank you, sounds good. > > FWIW I let it run on syzkaller over night once more, rebased against > Sunday's mainline, and found no DEBUG_LOCKDEP issues. (It still found > the known issue in irqentry_exit(), but is not specific to KCSAN: > https://lore.kernel.org/lkml/000000000000e3068105ac405407@google.com/) I lost track of what's happening with the IRQ state tracking patches. Do we still need this? Or would Peter's new approach (to make raw->non-raw work) supersede this patch? https://lkml.kernel.org/r/20200811201755.GI35926@hirez.programming.kicks-ass.net Which would appear to be the nicer solution. Thanks, -- Marco