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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 26316C27C6E for ; Thu, 13 Jun 2024 17:19:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bCBUr8yClhiv62amCq9XHy84ctcpdJzHzg0CnBMHsFg=; b=OnZCN6NPZE2w+7fC3h8USX1YTf tTYHyoJlmF1r/orlOluTrFhKRZLwOnoMnM3bHthNOQ8mDpJbjHQrSO8sv4GGP1UQUjMFbnTUTxCd+ smEXYjU9kD9Iiwk3KtSdC7RfUsA3zplg7m6ORLogk22VEOR/+yH8AG/moYdjxyaAfh6ejUQrx2iyJ tZKxn9kBk3PqsTBXtoN6AYd0wjEtxO84fXuBjD2sTI6OnqK/LDWCO2YhYejul4Ru/uyl0ndRJxUCZ iQMxqWa/IGWr2shXGMD7SvY0xRCj47jIUVEe2BbP7oWoInktT9RLC39cZ7cOIn7hnqYobazBJXNKF kq60o16g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHo6Y-0000000HUpy-40SG; Thu, 13 Jun 2024 17:19:18 +0000 Received: from sin.source.kernel.org ([145.40.73.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sHo6V-0000000HUmR-2gqQ for linux-arm-kernel@lists.infradead.org; Thu, 13 Jun 2024 17:19:17 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 50482CE26FB; Thu, 13 Jun 2024 17:19:11 +0000 (UTC) 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240613162031.142224-1-longman@redhat.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240613_101915_877287_9C96FB67 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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