Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp61596rwb; Thu, 17 Nov 2022 20:33:50 -0800 (PST) X-Google-Smtp-Source: AA0mqf63dR3KT0KEvSM3ryfeEDNZbe3WOp4y3DsxHo8SGt1LG8Gu/USxJb3L8E8kDduIyhqqLVVY X-Received: by 2002:a05:6402:1f88:b0:461:7a9d:c2ee with SMTP id c8-20020a0564021f8800b004617a9dc2eemr4788217edc.36.1668746029947; Thu, 17 Nov 2022 20:33:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668746029; cv=none; d=google.com; s=arc-20160816; b=sfoqlXQtITsW4gaKPI+pcpjbH1mXkDKdrK3PxPVN+s++ubki7L7QK9JfITaef5jzNd nBNwO+tjxSB3fZ0io+tJwW7hD2m71KKnYIa/DfOhFHw12bmRdDmiJqWrjRwesQf5zpvj 1m7CZJVM35bSdCH28JiCqcBllfou4csKieAAHes0Cmp+pOrLkaCA2IEmorLxViUPJAYX kqCpdfW5GxRKcCGxEDujoAPoABbKfkE3EChSguT7Cu4t044mrdFQYxr4bVzCLiZ62Fwz h2qk5OdurnvqxfOJ7KFA/zvsPwZ7IGCik7ZF8ioADAMyaRFkKJ2v+u/Lm8HT0D3VyamE lUFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RdQ4Wpm0oG6wCwcVAHNVtNpU18GLboO8YI77UCdhfb8=; b=xvlJny+nKhfhwL5tz9pUE+26tq/GJEckNP/zmbMmyJwbGVRi8/OaoO9NZxMPqQeNAm 9Yze9X2QSITn3tAyMi3d+RIJ/aNutOtjHImYea2nEqhRRey4Zg/BJlbarfE4wz9jxOM7 5nW2YqOGA5LP+/IF4sc8X5c609uOfDKSwib92ezMgDy/fEcg++4+C/8jtsjl9oSFAw4O W4ilCCaZXmyUxTnkiYg5SfZLeQQ+FFvVPGYUfvlFMVPswxcrz1+IuC/M7oq1hkZJDnV/ i4hCYIQLgvhg9voHWfJkrDNZMJPrdoxovZy2TLNmJvU4cJCrU4h6xToBr2bQTquhgyN/ 8Apw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=He0onnLI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020aa7d5cd000000b00462dca18096si2154302eds.520.2022.11.17.20.33.25; Thu, 17 Nov 2022 20:33:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=He0onnLI; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240781AbiKRDdZ (ORCPT + 91 others); Thu, 17 Nov 2022 22:33:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240780AbiKRDdY (ORCPT ); Thu, 17 Nov 2022 22:33:24 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE11911152 for ; Thu, 17 Nov 2022 19:33:23 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 59FC5622BC for ; Fri, 18 Nov 2022 03:33:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76D65C433D6; Fri, 18 Nov 2022 03:33:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668742402; bh=jlllhPzg40ifiNFyohWJbGJ7eLQfPAOOWX/cKetkVSI=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=He0onnLI5ceGUfoNFs6PDMjn4ByvRhL34/rt/I+kw/KZu1cNWCuZJbLbMuB3CRbZF T2C+kTUKW2g5fgQMrNcWbUtIJeSYgaXWrKYUS2bAptJYMLsYxoFVPjx/qdJEF31VoC hQqB+6Q+6166k0TOiP3FRMDT9jL2B7IiiwEGSC5gKkqJPey6nUBNvjROLRUTNHgfSo p/dMNNOrDuBnzgsn1MrEFt4WsCbpVcksDyJDormqmlCSIWd2OW4D+36W85ttElsGA/ EDOLlbLXeRp/C2pY3o5kY48AQou/+fMCASuzkqyJIS6w/Shp4dB0nfrJo/4k2ZhvW5 uMpL/BoTgsL9w== Date: Thu, 17 Nov 2022 19:33:20 -0800 From: Eric Biggers To: Alexander Potapenko Cc: Marco Elver , Dmitry Vyukov , kasan-dev@googlegroups.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: KMSAN broken with lockdep again? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 17, 2022 at 02:46:29PM +0100, Alexander Potapenko wrote: > On Wed, Nov 16, 2022 at 9:12 PM Eric Biggers wrote: > > > > Hi, > > > > I'm trying v6.1-rc5 with CONFIG_KMSAN, but the kernel continuously spams > > "BUG: KMSAN: uninit-value in __init_waitqueue_head". > > > > I tracked it down to lockdep (CONFIG_PROVE_LOCKING=y). The problem goes away if > > I disable that. > > > > I don't see any obvious use of uninitialized memory in __init_waitqueue_head(). > > > > The compiler I'm using is tip-of-tree clang (LLVM commit 4155be339ba80fef). > > > > Is this a known issue? > > > > - Eric > > Thanks for flagging this! > > The reason behind that is that under lockdep we're accessing the > contents of wq_head->lock->dep_map, which KMSAN considers > uninitialized. > The initialization of dep_map happens inside kernel/locking/lockdep.c, > for which KMSAN is deliberately disabled, because lockep used to > deadlock in the past. > > As far as I can tell, removing `KMSAN_SANITIZE_lockdep.o := n` does > not actually break anything now (although the kernel becomes quite > slow with both lockdep and KMSAN). Let me experiment a bit and send a > patch. > If this won't work out, we'll need an explicit call to > kmsan_unpoison_memory() somewhere in lockdep_init_map_type() to > suppress these reports. Thanks. I tried just disabling CONFIG_PROVE_LOCKING, but now KMSAN warnings are being spammed from check_stack_object() in mm/usercopy.c. Commenting out the call to arch_within_stack_frames() makes it go away. - Eric