Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp329694rdb; Thu, 25 Jan 2024 17:35:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IHitRg7sGtVJTCWY4Wdj5UXb5+7w926Ky3e+n+3uS0JhRQnyRjA2+7hSovZGB94NTWlJ3Kr X-Received: by 2002:a05:6214:5294:b0:686:2ff1:8de2 with SMTP id kj20-20020a056214529400b006862ff18de2mr588882qvb.41.1706232957415; Thu, 25 Jan 2024 17:35:57 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706232957; cv=pass; d=google.com; s=arc-20160816; b=FEk1pyqypAhKVCviDCamogqBKzncS3AWdlHlkVqrNG9gIt5GTXwT5ZOFcpxG1IgPJB 0kKm7GFqAgojesmVd5DD5BSlEH+PuW3jTgYStBbiTENuu8wbV4RHijruMG9zY2eezAzH FW06fXXzjBOV2C+gE9DWJiSaBfk0JbCiUMVXX2mLKWfJb2cyuQrOPA6OIZSudiq2Ybdi fAqffsQMJNHGuaw/EZ3uHNujvFAkTDqxxC7jKzj43O74q054EKlwPAs9fX9HSfX6Qu9t 9mXRTsFGtYzjJxjIqeRP30rz7w1O507DqmIUwYi9qCZwE1AaCZz7QnN/nj0Xs4R5bYxr 3IJQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=BOnTIPkHjKHeZptNyEKK6utwNyJxAgnqgtWJh28DSoY=; fh=riBrxcA8Qh36tUJKE2+2vGuKFsUK3hAVMFrwnmES8Bw=; b=Mj5T7VqWiYaTm2Gfi6O8wgFE/z2ITcUPZs+e+ZH2TQOeiSdIn0mMateHO3PR79MYVl YJ52dySKxo/qkaN+amTr5arJ4La5Z05vu/Tf406lbJp++oizYQtIdHJ/HC2SkzZ0Lxtv kjiB6OzzuRwpWabk8mRypYYj/kQ+jbzl0rAYswuTOCtsyC2leqTjO+tOBeYBFG5R50XS HyO9YmkERD8yfXO00/2S4ViZjzBQwq6Ay3UuV8yE2HhLyTQYgXG6L1FBty6rAP0RI0l4 w2qV+E2m0a4voXswb0AEvOjP31bEX4WmOEy5LVlS8hiY7tPsvkqMzNg39agYXC5WhWj+ nMSw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IanaUHsb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-39498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39498-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id i4-20020ad45c64000000b006805f51071dsi257286qvh.40.2024.01.25.17.35.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 25 Jan 2024 17:35:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-39498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=IanaUHsb; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-39498-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-39498-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id AB34E1C20DBD for ; Fri, 26 Jan 2024 01:35:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2F9171115; Fri, 26 Jan 2024 01:34:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="IanaUHsb" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 52B7964F for ; Fri, 26 Jan 2024 01:34:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706232896; cv=none; b=qf6SlzrgmuYCHVmoWzcEJf+zl/rKktAPvJ2ANPJu0+5OHZpzGIMeSZotWYP40hARd9gF59PQjVOxpV7xnahP7XG8Bm8itKJm2gKjjct3C+j76+LPAj4T9V0LZxtI6Wsxwaz7N3hkYOICA+HDdlkxBIF6GEIJugTb9VZc3SLlUQc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706232896; c=relaxed/simple; bh=afoAW89H08rslmzulqbZV8XGWxbnFdKdmZKuI1WAsP4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=m0CW7DgR4AneTIBst+BzHiQPzLSdjFoUEQeP/9yRoWxnhgtesMj69ODUMSBIJuZkbtcLRPgjllQNYYGE3ZLR3N9ETAh90my4bcrTfaCwptMIDOMRAUmoQQFaIg6aE3e+Bpozld8PWWEJ/LllpU484VaDwCT4BH3ZAkLtyPew5B8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=IanaUHsb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 963F9C433F1; Fri, 26 Jan 2024 01:34:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1706232895; bh=afoAW89H08rslmzulqbZV8XGWxbnFdKdmZKuI1WAsP4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=IanaUHsbwsrPyXz0XY9VEXXk/gyZBy4mrUr33oo2NC24Ta1Q3FzFfradVZuC9IRKZ knaIeGfU+HOmh2HFBoWNHLsUxN2b6q33uRtLmh74swNkkK5ys4VU8Xtsk3e2esq4gz UeDCfGv8BTlY7sD2R/k5eipIs/M0lXV7Bf0LGB4E= Date: Thu, 25 Jan 2024 17:34:48 -0800 From: Andrew Morton To: Alexander Potapenko Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, Marco Elver , Dmitry Vyukov , Ilya Leoshkevich , Nicholas Miehlbradt Subject: Re: [PATCH v2] mm: kmsan: remove runtime checks from kmsan_unpoison_memory() Message-Id: <20240125173448.e866d84cda146145cbc67c93@linux-foundation.org> In-Reply-To: <20240124173134.1165747-1-glider@google.com> References: <20240124173134.1165747-1-glider@google.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 24 Jan 2024 18:31:34 +0100 Alexander Potapenko wrote: > Similarly to what's been done in commit ff444efbbb9be ("kmsan: allow I make that 85716a80c16d. > using __msan_instrument_asm_store() inside runtime"), it should be safe > to call kmsan_unpoison_memory() from within the runtime, as it does not > allocate memory or take locks. Remove the redundant runtime checks. > > This should fix false positives seen with CONFIG_DEBUG_LIST=y when > the non-instrumented lib/stackdepot.c failed to unpoison the memory > chunks later checked by the instrumented lib/list_debug.c > > Also replace the implementation of kmsan_unpoison_entry_regs() with > a call to kmsan_unpoison_memory(). > "false positives" sound unpleasant. Should this fix be backported into earlier kernels? And can we identify a suitable Fixes: target?