Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp4605982pxa; Mon, 10 Aug 2020 13:19:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx2C43LbB1Jq/ypMiS70V4pGhYNQOSQrnP+Naz6wPdiFOI5SA8/GPE5W/m2ZoVvXbmf8bib X-Received: by 2002:aa7:df8a:: with SMTP id b10mr22061112edy.62.1597090793030; Mon, 10 Aug 2020 13:19:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597090793; cv=none; d=google.com; s=arc-20160816; b=A9If6mhgNUNQzFoX8TFsOzsmn2XNsQFIhP+bqui9ShVHmEUeKSGMIUPFsg6/4XSCwt 7ZOXeHmaKwpP9kpSaWMIxfryJfx5Py5UafFnY6PumrDv0DBCD/UwiS1g1IC97MKaplWk y2zGOsFg6dHtDSUsAD4ZXD4Ng9L/SDhJVxildWZPU/zfsPBD4myU2sjA5JZQ/NSUFBFp pZ88h/WrkGAT9BRfAtsY+JoO3zPeTBgXHDT/mZTBPkdT2EYTgSS9k+cC1D9VH3Dhi2CO NBbu6Vdqz3rMTfBYe+2YUPx7HPEBru1tquaaxv9KEkpTxpTjog/x3Li1zvoT6OkEg8hO c30w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=MipIWmCfz+EbbW+HlVadROmknV5HQ2RLosQPnMEF508=; b=O1hol0jKJdRKA9Xqh7gN5EVOA8N5AkHQnCir4jQU8z4qjpjRlwXsmsQTYQYiU/hI0p RipH3qQ5nM22WQhwI0ZYy1wVPDq7DoP4b6uC20ZiwTFmTeY6P4hMtEtqk8JcLZEk+BEO 1a0gdBwZQWHcRAKT6XMEz6SskHMWYky33Wd0vKWs6hTQyISENS/Wn/l4b6ZYsatx9GqP iBZz84VVUoW70NWf6mK48n0LNAB7Fnk57KyxYUSE9xLeIONvqbXvkNilQgMHJy/LlL7q W4MkoCpddC0la784Nh53BRB2YaCrqMctRrQCEOk9qXL0o5z/zA6nJ9h0ZnkcKvuSRybl 0uPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=oqzjQJxi; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NWICybjt; 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=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs8si11386970ejb.665.2020.08.10.13.19.27; Mon, 10 Aug 2020 13:19:53 -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=@linutronix.de header.s=2020 header.b=oqzjQJxi; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=NWICybjt; 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=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbgHJUSe (ORCPT + 99 others); Mon, 10 Aug 2020 16:18:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726115AbgHJUSe (ORCPT ); Mon, 10 Aug 2020 16:18:34 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FE7DC061756 for ; Mon, 10 Aug 2020 13:18:34 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1597090712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MipIWmCfz+EbbW+HlVadROmknV5HQ2RLosQPnMEF508=; b=oqzjQJxi+4EcDxIZ9TU1nrguRGzCpmPnUTFUAM6jIA4xNysviZiL5sS29BHM1bqpXFjEB/ /LHjM9cBRImWc18sPVukjnqihkNQfjOKVhy75c08Q0quj7MnV2jOtACaix54ER29RMfe/F s/grvw6lQoVzLR7aVsZ5Cy6NKwChXSebyb8wo8ok+VipdJgbY4cDU7mihtEsDyAtSi7mXe Ne8K+qiWXsg77A5uD/rd3+P7jPFYX9+II9SZC16v9ORT6Ydf1GJyjAfv/xGz3JpVuS9aXB 1s9bT8YMo15EZ493pcrdBv3Lw/m/lsDneOJhPMhCg+JNXqAg/oGH2Xdy3ujvNw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1597090712; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=MipIWmCfz+EbbW+HlVadROmknV5HQ2RLosQPnMEF508=; b=NWICybjtsMz2c5z8VLivQZegGL5UcHOP1KeIBQcSDvohUIv56mOGmsE7G3BKvW4qcs7NDS vPTD8bhNRw6FBTBg== To: Marco Elver , elver@google.com, paulmck@kernel.org Cc: peterz@infradead.org, bp@alien8.de, mingo@kernel.org, mark.rutland@arm.com, dvyukov@google.com, glider@google.com, andreyknvl@google.com, kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, syzbot+8db9e1ecde74e590a657@syzkaller.appspotmail.com Subject: Re: [PATCH] kcsan: Treat runtime as NMI-like with interrupt tracing In-Reply-To: <20200807090031.3506555-1-elver@google.com> References: <20200807090031.3506555-1-elver@google.com> Date: Mon, 10 Aug 2020 22:18:31 +0200 Message-ID: <87pn7yxnjc.fsf@nanos> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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