Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp301177lqs; Thu, 13 Jun 2024 10:19:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVDgwXBfhbCjdfEbCkSlDR4akkr2jkEl3+heWJSA3//oxti7WDDRy+xqDCT2uRtJ0HyGIj+EN8l6KE5/qnCJV0Pmpa0oI/9oNw8Hg8gFg== X-Google-Smtp-Source: AGHT+IEr29XIQFOTod/DjalSyzHlbB8LuBxCxlsUcgX6V1o913tfhZUpgOGYNxN/4VtRf64VNTOg X-Received: by 2002:a05:6870:8995:b0:254:c397:8127 with SMTP id 586e51a60fabf-25842b830cdmr213993fac.58.1718299191012; Thu, 13 Jun 2024 10:19:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718299190; cv=pass; d=google.com; s=arc-20160816; b=ZwyWpW3M1GDnXfYBZOPd90zoPqAIK7Et7JTlUuZRaSU6qXdLZEBD3Rk4dnKVf9dOYk 0QXWYGu0UD9gAwjiRnaUhk7uonfipz2HUXfCrK/84aUbc4q0CEw00gjTq0Z1i5FGGjML xFDqzgHKbU02gQHTrPcB+BXIBv4/ay/9kRV1HDUDpil33V8n1eHixrGU4C3mAVLsln/T /X8c2NCH480w1irb0ciy9W1Uy3lHkgOrzhdOFS+Lh4bgTr2e2HZEajwuIf7vNAB/JvHC 2Wvd8CepYnsPwurCZcLk0CDXNLOY9SDmaYwj/2jq2KO/4/yWw0TTlJ6GA0bh6IpGzdDt lxDQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=bCBUr8yClhiv62amCq9XHy84ctcpdJzHzg0CnBMHsFg=; fh=SUIUdTsDtENI/WufGy1ri68p4sG0rhkMDJlp1VmkQUA=; b=BVspei0wJKlTjJgmcF8G/EKRXZGeANoTrb68JZ+juatg6PHNS2J2KHNFCaN+WZn8RB Ujimdu9RvtGFTH9p3JP/LSv5yAcqLCJhvMhRFqouBbpwsAWEnGerR+WulFK9QWRzEAdk 8Yc0qe+PW4LiJao/Bg2hcoF4wWOmw6cPaxKdTMZ8MxSkZJUVk/dlEEopI3aZVs3ctnk8 EbWGFoi2KOqycg8Th6wrgniOFAq/z9/g91SqUW+6cDPssYIEG8PQ7FOmpqyoXT+Bs5Za n2U6GJWTn9VXp9L6QCYNtA430c40BLtSdtDWYFq3HQEVFcQQu1cfqFjwIt8rjFsjPlGr E6mw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-213732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 41be03b00d2f7-6fee453c481si1653171a12.537.2024.06.13.10.19.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 10:19:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel+bounces-213732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213732-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9E2BE285329 for ; Thu, 13 Jun 2024 17:19:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C3F6214AD19; Thu, 13 Jun 2024 17:19:11 +0000 (UTC) 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 49FAC14A62F; Thu, 13 Jun 2024 17:19:10 +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=1718299151; cv=none; b=srYmRtpgyVmGmrUH3YV4pZw/D/JmsnEhKr6iS2QEMnA+/CH6PCh+sRBg7hMZfW6jl3UcmbgzOwhrciU1fi9SOs1hl1CDqNtOCXOKqqP2P8fakfE3UDuN5oPIF9A6VCoGofWVNEOhMpa/7maoXtxOBrsV6cU/plgnCUL9EfDK2iI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718299151; c=relaxed/simple; bh=y1kH8xzI8T8Uj60m75aLu0+Pa+JTu+23CAjyZUqTDEo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=fBpWsctPkIYh6f7bzl29eSKta2IZ3gwGJ2hNTBFD5jMB5ipMaybvXedLGxg6AZXUMAUN6ukWnwt3mF7xyh+Cx8jKjzDDhwmVfIp57PKRrMF5/uxr2BNfLChKJSNWww40f+qcFVGu68fIA9JjXn5GAIsa8wcFUYM94JodyeV7Qlk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A4567C3277B; Thu, 13 Jun 2024 17:19:09 +0000 (UTC) Date: Thu, 13 Jun 2024 18:19:07 +0100 From: Catalin Marinas To: Waiman Long Cc: Ard Biesheuvel , Will Deacon , linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/efi: Fix kmemleak false positive in arm64_efi_rt_init() Message-ID: References: <20240613162031.142224-1-longman@redhat.com> 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-Disposition: inline In-Reply-To: <20240613162031.142224-1-longman@redhat.com> On Thu, Jun 13, 2024 at 12:20:31PM -0400, Waiman Long wrote: > diff --git a/arch/arm64/kernel/efi.c b/arch/arm64/kernel/efi.c > index 4a92096db34e..712718aed5dd 100644 > --- a/arch/arm64/kernel/efi.c > +++ b/arch/arm64/kernel/efi.c > @@ -9,6 +9,7 @@ > > #include > #include > +#include > #include > #include > > @@ -213,6 +214,7 @@ l: if (!p) { > return -ENOMEM; > } > > + kmemleak_not_leak(p); > efi_rt_stack_top = p + THREAD_SIZE; It looks like a false positive and the reason is that we only store p + THREAD_SIZE in efi_rt_stack_top, not the actual allocated pointer. -- Catalin