Received: by 2002:a05:7412:3290:b0:fa:6e18:a558 with SMTP id ev16csp729412rdb; Fri, 26 Jan 2024 08:57:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IG3RIIZQu3pTLS8BLOh9fLsGVt29/ODBc5HyAV/tJIxwlS6JQ6+CyXFsR6/V4mrTDrkooyP X-Received: by 2002:a05:600c:458a:b0:40e:6334:fedc with SMTP id r10-20020a05600c458a00b0040e6334fedcmr57952wmo.94.1706288275506; Fri, 26 Jan 2024 08:57:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706288275; cv=pass; d=google.com; s=arc-20160816; b=zmfIXqR1IsfJ/m41A/nfkvLoru1b2ZZn+wtyeVXs8GWHvvlR6RkZ+d+gH/K9B/WCOp U51QtsHAMQh8cqdnj3l04I9lV4YjzyXmCKNOmEgaQhp80+TAzXjg6cKhItz4VvqptN1g g4NbL6U4dvzlHwBn3Ho1izfJtSJANtCJ0Wo3pm/BJyuIE/Ozr9xyMCK/88ogayYga+yL lkPojJY+u82pagvzvWF56IbFt4a7OPrwHMcY4NA+g1YyS4DmsoLxHIgj20FYNus1skno DwJxQ02krRCu5Qg+NPJzeWucTtJe1uRXca1ohczBHG1OO1LwyahBUbweqK9BThqy1A+d De3A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=W8wQho2kzTpQJAHRtDOw4DoWvclzdYhTLnZmTHKhh5A=; fh=Gi8QN8lcYcChPGxnE4J+1Rkj3OWOJKHIyqbcukBRJ1k=; b=InBgF+Uwi+IDcmiw3Ig/DYA83hLFRo22AvDWAa7wWtcTdzyKBx/jWRef1FxDSlT1Fu 7IHoCDwsUYhrqbJ0+p/DNqKFuG1S5XlcCdifBrgMEWk6gVARq8LtI6+Q8ZD9VVh8peOm s09x2oVfb3Q0RQB4u8d9Xy+Hi0ZdJAwKlSJMjrKFqXxPV90AANiUOSoU5i63n5tFsvdu /oeGnzOqFllas5fySK2pQTDcPNgwIhLpFQsdMv8NcWCZ1QRO/BA8X3nq4XFFAOjTkN0B V9VNwy+Wjmu2Ce0e2X2SdxNunzWEZ45Fgn7kSWgI/bY0/p9ojxheJAwu0Binw1xputaN ENGw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=v0yMszEb; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-40385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id q16-20020a170906541000b00a30e27bbc9csi753287ejo.115.2024.01.26.08.57.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jan 2024 08:57:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-40385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=v0yMszEb; arc=pass (i=1 spf=pass spfdomain=google.com dkim=pass dkdomain=google.com dmarc=pass fromdomain=google.com); spf=pass (google.com: domain of linux-kernel+bounces-40385-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-40385-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 3864E1F28EF7 for ; Fri, 26 Jan 2024 16:57:55 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D78751DFD8; Fri, 26 Jan 2024 16:57:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="v0yMszEb" Received: from mail-yw1-f179.google.com (mail-yw1-f179.google.com [209.85.128.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B20E51D545 for ; Fri, 26 Jan 2024 16:57:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706288268; cv=none; b=t248LLPorn0I/4Qs3phubGZCdUo5p31ixYQhH+ouDkAiClOnMopwY5hEdT1m3UmPtp5eKwQoW5kjrBEjgsYBCKwhRog+mXzXyyxMJ2IgNR43Lv9p6zVmAgrw06DZrVOBOydQb4F9nE2FHcZYGuVVmjg06824XNFn8VUzUpZSalU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706288268; c=relaxed/simple; bh=EvCafv1sut8qM6qKIK1YMxvl8RZrjtMxUcDY4rmzS2g=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=OqxeR0+BZNbAZoG4Zc9ibNGVYn51exQ0MYfZpG9pSeFwGgEMtvirbduA3p826tMK1x16ZZhn6FmJP5kAggSHQ6TTaBQivwPI+AnZ88ZrgqSJaut784OZWFtCDr4PHVtotscgH/I3dD4utebn7iFx2aHJbeI81aW5q65WlzFHNNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=v0yMszEb; arc=none smtp.client-ip=209.85.128.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=google.com Received: by mail-yw1-f179.google.com with SMTP id 00721157ae682-602cf45bfe9so5697677b3.1 for ; Fri, 26 Jan 2024 08:57:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1706288265; x=1706893065; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=W8wQho2kzTpQJAHRtDOw4DoWvclzdYhTLnZmTHKhh5A=; b=v0yMszEbJCHLJWo3nmkZ1zNDPvRKTPxKSyvT7TmUADU+AoAV+WFHx6M7RePN6wSi2C E+Jotprv4T+YxcYtMCbcbQDAVetgApjWzW0Pv1hkYHcaLB7QWTvIdPcvKznGI8RHh2VK sATXpx8tHKY7TvTiAOO79jLMynanjZY6wJdLxBrMIQZKcJoC/E8IfOA+gdrPIijwKDJ0 i8H0q4Perd822+tlSPYS9s6HpIFDq9AtRGjysomhlM8N7Dlx8qekZUOwvyLASHdkfskr nggaIGGH3yX0n8y4/JA9FM0bCkuNhRRCwJ68yk+7EWi6t0Piux/fztfKLOM/rPlxC0Ym VklQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706288265; x=1706893065; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W8wQho2kzTpQJAHRtDOw4DoWvclzdYhTLnZmTHKhh5A=; b=qEKdDoLVovGouOYvFwr9heWKnXBO+AAAFkh9R4cNLf/8LD3Dr0fso9jHWKleL1Q2MS HUvolvOYWBbtzPwBmisqj+TJftS5Ly97KVVnoVRwJpAPzm/UGKYXgIuC1x4Y3KxRWSLa Auv2QOps9m9Ix/181rUMiAU90tlnceRojZkV0ICSM0Y4KBIdOr40epl3gTBSdOhogeVI l5QiQnEs9e/+i5pJbMYj7MfpMyI+22O2TrMEBsUTQtFH0ybnzpqXBQSMxoLSQrul0qyS eSAsJK3jVExyTRxBHGQQmBgXkrp2YOoZjYuQn9V5h38nimfIz3rUqxpkbtfW+WBRu5Ub 4aVQ== X-Gm-Message-State: AOJu0Yzuv2AZbH/KIr79pOM3G7DgdrEF6A6s43Yd5oRgJMaC6xxQ/ZWg SA/ORe1YRZDvzLOHoEVivf0YO8JRXb2bMRzGSuQSE+wZQQNWF/pXR9pO4xnBm+OL3T5/kryX0HI k23epb+zYdFJTamJK8e5lkF011arTUlXveGMq X-Received: by 2002:a05:6902:1003:b0:dc6:48fc:65e4 with SMTP id w3-20020a056902100300b00dc648fc65e4mr125320ybt.40.1706288265435; Fri, 26 Jan 2024 08:57:45 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240124173134.1165747-1-glider@google.com> <20240125173448.e866d84cda146145cbc67c93@linux-foundation.org> In-Reply-To: <20240125173448.e866d84cda146145cbc67c93@linux-foundation.org> From: Alexander Potapenko Date: Fri, 26 Jan 2024 17:57:04 +0100 Message-ID: Subject: Re: [PATCH v2] mm: kmsan: remove runtime checks from kmsan_unpoison_memory() To: Andrew Morton Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, kasan-dev@googlegroups.com, Marco Elver , Dmitry Vyukov , Ilya Leoshkevich , Nicholas Miehlbradt Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Jan 26, 2024 at 2:34=E2=80=AFAM Andrew Morton wrote: > > 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=3Dy 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? > Surprisingly, I haven't seen these false reports before, but the bug has been there since KMSAN's early downstream days (at the time we might have needed to have those checks). So it should probably be: Fixes: f80be4571b19b9 ("kmsan: add KMSAN runtime core")