From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0D4BAC433FE for ; Fri, 18 Nov 2022 03:33:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C71F6B0071; Thu, 17 Nov 2022 22:33:25 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 150256B0072; Thu, 17 Nov 2022 22:33:25 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F32AF6B0073; Thu, 17 Nov 2022 22:33:24 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DF0BE6B0071 for ; Thu, 17 Nov 2022 22:33:24 -0500 (EST) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id B14801C66FA for ; Fri, 18 Nov 2022 03:33:24 +0000 (UTC) X-FDA: 80145142728.06.689877D Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf27.hostedemail.com (Postfix) with ESMTP id 43BE44000B for ; Fri, 18 Nov 2022 03:33:24 +0000 (UTC) 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 420C462213; 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: ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1668742404; a=rsa-sha256; cv=none; b=yI5AJ2TcdU8lJUCqvGSmjM6Jb9gxrgurEgEtPP7yoCC9ikZHyd6/8ewxYvTlVfXPwTO7E4 jQLBm512aDTZjPoxIl/sGl8w+uJfHc8bZRK2bsdHB2aQe96UHvpvhbPlNjb3aRelCCvVPP +/sGP1MzJKj7/740CkGER8F/nP7PzZE= ARC-Authentication-Results: i=1; imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=He0onnLI; spf=pass (imf27.hostedemail.com: domain of ebiggers@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1668742404; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=RdQ4Wpm0oG6wCwcVAHNVtNpU18GLboO8YI77UCdhfb8=; b=AeUyXMbqycNwN03DMZ8UCKsoYoKL2jGVoRESGBpVpEtChygdVT92a59ez+7uWXMhLCbJrP jP2ahjYNSm680UWD8pV3HE3v9GCrzRX/gGZc7hpFg+t/3UuAUK2lDulusih8Atiarw+MUF AFLOdWCjoubRiiNGaM1+2xYrN+vd4Qk= X-Stat-Signature: 3ow5fnuwk85opxk9xat1gcn13hoeknga X-Rspamd-Queue-Id: 43BE44000B Authentication-Results: imf27.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=He0onnLI; spf=pass (imf27.hostedemail.com: domain of ebiggers@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=ebiggers@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1668742404-586725 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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