Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp195308pxa; Mon, 10 Aug 2020 23:57:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSgGjXM2lBrOHPzWE+Tg3XWoXOK5kn0I0kPMRQY3eE2JjnLWkacQAh+avKTIafQXvOYecm X-Received: by 2002:a17:906:a84f:: with SMTP id dx15mr24608997ejb.377.1597129053286; Mon, 10 Aug 2020 23:57:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597129053; cv=none; d=google.com; s=arc-20160816; b=WXVh2J62ATuTDAi+UnnHM19IiGd7cQ+6J5yad6vjQjBIv7idMc3UJp5I1Tys2SZUY7 Ao3hjbPQdSorj/eUTFQGVOBiGgjAkAmBCyxPSlXq5IW3rby5GgMVdl37sHXSUf8cQLek X65O7yMgKSmCB26S7DTWH8OBCH0LEs3boZh/pg9FFtcDudmTYpS+hDFcJg5qu9xd17PV 3b735zPM8a1tvo3kcq7dF+byDUiDsI6ORP8Ila+4kYI5reki9z7qVDw13lrHaaQFITkf xzhFBjRgPSiTO5siYx/vHiiKTSPLOPLThBODmqzqWkNUA6zG4VI6o/6tbdwED5/SLULz MqCw== 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=qBONm3JGSIredide1r1f2aq4pO6yJwD51o3qC+jyQL4=; b=dioLOTGBQVSdaMpV+z6Psdcv7ID3G1t6FgMy2251pGYEYwV234+21lEzjlVhWFJIvh KfXTUc5iHozzGz8gbrtNgcm+yish89mRaMwco2cbInFiatM0bQnVSTYR8Kvi6+xuuY4B zGYMpZIl5qT4uGb9a+budvt3EvdU1w4dfqXzOtEO60pdK7Fui9GYi8TEIXv2n5jV9yDA Xjcu3Mt9JU88iX2tTumrSmOKK6vXKQ7ZyPKWohHqo4BUh4MdWYj9VS+gqEPVjH18wo7x 4ngkpPt9TSEj2Yin5OcXJSHb67qxd/elx7VfUROAryjPp5H4UnCYN+UGMxEmpYIOAo8R NuUg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=uA2yZ3mD; 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 ju9si12640827ejb.266.2020.08.10.23.57.10; Mon, 10 Aug 2020 23:57:33 -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=uA2yZ3mD; 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 S1728252AbgHKG4X (ORCPT + 99 others); Tue, 11 Aug 2020 02:56:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37610 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728018AbgHKG4X (ORCPT ); Tue, 11 Aug 2020 02:56:23 -0400 Received: from mail-ot1-x344.google.com (mail-ot1-x344.google.com [IPv6:2607:f8b0:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 317BDC06174A for ; Mon, 10 Aug 2020 23:56:23 -0700 (PDT) Received: by mail-ot1-x344.google.com with SMTP id 93so9352856otx.2 for ; Mon, 10 Aug 2020 23:56:23 -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=qBONm3JGSIredide1r1f2aq4pO6yJwD51o3qC+jyQL4=; b=uA2yZ3mDI1T3Jw/4Vw6Q4OmEX9280h204wtCZslPvkbSbJ++eKzvSeAhhrNM1Wljp6 Y7jwvdnHOJmxy2ME53uMlxfjGa8nNwPpcWr/eBJiwl2SQ2nnOnvaZ+SGE7nDsXWULQZ7 l9ABu3WkNG0A+tWxm0LMfVE3BbTCxIiruxb7xHNggyPLUXgHojv9deY8GtcOSZFkTZtO SWPZ2yA5TVOEclgWK5w86Rcrjj3rOLPXLXaazg3ubnN7o5BLTV+YhfiDJ6Dr7w6+pFPG c95FeTXCtPyqJ+jsTtG0H21f7CTsb2o1m4nK/UVIA2rU4KEvTowNdSbe2y0eBJylenQO 5PFQ== 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=qBONm3JGSIredide1r1f2aq4pO6yJwD51o3qC+jyQL4=; b=s3RZLuRuI+dXEnxC6EdAOrRsPm1wa9qVCYoG6mfBSc6MCX3UCqvy2OnsnkH7M+PnW6 i6G0E9jOlNnq77qbI6haElw1o89vSlwbnjRjOH0ZeZu6o5rFWjQ3i4ZjgCZRYFm9XPG5 aX8y/onfwAX3NR8vSQgTc08mwJ6lDxo8MpYiZ1S+Hvg+lpCz/hNKjyYQBADM5xSLlmr/ 5G0aFAngE34yXoJA9Eia8/SHt6J8zjPQPKSH5ssqEeYafMHKhCTXNh5H8SXmJwabW2Om NtDp/V2qCO1htO+GoA+NJ6G9KOH2N6BquV7cS2+kgl6E+PcABbyikelWIqAWK3XZ7nEq J1FQ== X-Gm-Message-State: AOAM531gs8EuSNiOYGymdzrafaJkjodVjr5MlFxivJFvoJmNIp/8PVhn Z8SAKlVkjURHisI2Ak2/+XmfgMbm2CCo87Nl9o3+tw== X-Received: by 2002:a9d:3da1:: with SMTP id l30mr3989495otc.233.1597128982279; Mon, 10 Aug 2020 23:56:22 -0700 (PDT) MIME-Version: 1.0 References: <20200807090031.3506555-1-elver@google.com> <87pn7yxnjc.fsf@nanos> In-Reply-To: <87pn7yxnjc.fsf@nanos> From: Marco Elver Date: Tue, 11 Aug 2020 08:56:10 +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 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/) Thanks, -- Marco