Received: by 2002:a89:413:0:b0:1fd:dba5:e537 with SMTP id m19csp266418lqs; Thu, 13 Jun 2024 09:26:09 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXJtLmnT2z8bZFd8P9DCxeZYx11lKVdTP75+GwP85vjOvqZKOGXMpQZmyXmd+kaH7Itaq2LLSq4BjLm0VdTXoHUdJALGrJ/egxgwZy+8g== X-Google-Smtp-Source: AGHT+IH5a/Ox2/vZSsTaYsXRVIY2bkisyulLSnDTA/KlXiJ4gSDK+LJi21NKsVlzV9QLLrYEkMin X-Received: by 2002:a17:906:3c8:b0:a6f:4f2c:1936 with SMTP id a640c23a62f3a-a6f60d420dfmr18775066b.44.1718295969723; Thu, 13 Jun 2024 09:26:09 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718295969; cv=pass; d=google.com; s=arc-20160816; b=rtsrn0FahA5k+4msPjvKvOaJiZYfKyVfQD5ZGKBZX8yjt8jzVfQ6tpbTcf9/jDdHgm fj+T35shQ5m7qiXvHXBCDT91UdsuJu4hai1TwXo8hqVrrDHouakS1HJTvYhbCOl/YxUx 4yejDkJi/M4hH2gsP62AkC9zIsgVw9APBBv+6oBT4K3d9mDx/b7R8whFXBz2YQilE/Ep ZaQUOsbqEq/3R7Ab4WfTAhOWoVTBIwvAVXzLMSC6hWgdkZS9wYaOeoHIdjcnI2HU6JxS 0QE6jC7KienYwgA82tTAFSYRisT24hVQqnS8d7lnDJcu0ipTQU54zhzY3mLllCoQDbQO S4jw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=kbF4faeBnBOXxf8TKEPsZP2Rv2/HGpJeUkN4hm4Lvss=; fh=WezleuxlfcUdXKScyUertGIfsLpBGMnhJOb0dfonssY=; b=mjLfEe9MHxpF2cuJNEbIrb8/pCJ37zvP6K6mXhiYIHDLDnu9+siXgkN+2HgfI4tPIm +lFZgDfr3Y2g7QRgCe0dm1TW8hQsTKAr0DibeBlQQ50Www4MKYTVuMymQQU7wCPvkO3d lbXo8LeGCLa7QLlz87b/Ix2XosnijV0HOrYynR7YacqO/cDrvp23oueti3UqsvIBmZuR 8q8RuR0K9zk/rrQWYIPyZL/1putp4ZdzO6X0ktmh6v+fWQo8+OD/+KDYoMwvh4OaQuGx TJuCCHDdJmVWpMUnuuhD7w0t5XnbMzL7wzu7H6mHe95GlGGYS2ZRzXHmm511vVPL3p28 fCSw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K6qjxhOj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213643-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id a640c23a62f3a-a6f56d2133dsi82086366b.93.2024.06.13.09.26.09 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Jun 2024 09:26:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-213643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=K6qjxhOj; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-213643-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-213643-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 am.mirrors.kernel.org (Postfix) with ESMTPS id 6C59E1F237D6 for ; Thu, 13 Jun 2024 16:26:09 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CACE21474AF; Thu, 13 Jun 2024 16:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="K6qjxhOj" 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 F2AC2381B0; Thu, 13 Jun 2024 16:25:59 +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=1718295960; cv=none; b=X+tatzKgEhchV18uOMCYVU+rVk3tNgFSYYXrNVS2OEe6U9s6wdLSkhsVLjPj2WxX8aFavhTs0FlOGNjihfRElzNzHpW3oOYgqfzXhF1D7xh+KM8uGns+EuHUnNTjyqh5SJsqOXS+S5K+PDhUq5F0sB9pUSrfkYxtYUXqf5XkqT0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718295960; c=relaxed/simple; bh=PGv+Yopc7XLHNBcbDN2+JMRLeaSqYKy5SzRpJAxLlsc=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=nTl3CHMmKwYF4F3zup8RoH7eOPNvHuSrwRR4qRLHIZcTPnUxkc0A9ha/Eqym60OOJgOA4kA4kSnp63qawvHz0IHydS3a8s1EmYStLFsXzGEBkgQXqmNVurR68uiLWpZt0/yo6TK1UcxmEeTvPCLqoS1RVpsRd383/sLPMn7lRe8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=K6qjxhOj; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF20CC4AF1D; Thu, 13 Jun 2024 16:25:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1718295959; bh=PGv+Yopc7XLHNBcbDN2+JMRLeaSqYKy5SzRpJAxLlsc=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=K6qjxhOjkSoyi6cghmlsIyEt4KaCiv81iGTSX7mA/Yjv0gtZe7JU1P9Oi8QUB5yNK DfxOPyKSdZrvFUyMwkzTAQt2ucgVjqkavXFfpuOW2Ks5cujJGA4qy7HEvtASD30DSm DPfgsJA3BvUOxr7ZqTKyfO9Gs01B8DglvYqbd0zt/y4RJIbsriNNP0MT18hrxBsGxc uR5rzbl1jurwk2Aqa34eo4a99YGUNv8eTJ7xEINTnHOlXHHtgPgE9n1WTnFVBjpxpq 8Wj0O9LMGPlnHE9XM9DMNV3Nh2ZJRYw0+Qv3FetQHMwzr1qvMSv80WNtRLl263xaq9 OtT8OgK/6TUmw== Received: by mail-lj1-f169.google.com with SMTP id 38308e7fff4ca-2ebeefb9a7fso12275951fa.0; Thu, 13 Jun 2024 09:25:59 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUVRe+3d6WG533EEQSUipemDpxPV/1gSYZLwKKbFTRzpj71i6ifIezeridwvk5cWLa1xdLD0rWhCvBdP973XegBWh0D93uRyEZ6SJh5kJw5cYvT80TWGQDKAf+Dpgn3BuXdjjF5pYH8 X-Gm-Message-State: AOJu0Yw27sZJ/mLlY6dz91EVilNwQ4ZjSvQin4MJS2c3/p1loLCEqKpf lYXJqFnKtF/JaYxvKTRHdy4l8THiZEz8r5qGnLNRQCzQFX/xV6EPfifFOTjbpsCEOiUloWLrQ7I DQcYWRv30M3P0CNLNGG81cxMlDoU= X-Received: by 2002:a2e:9056:0:b0:2ea:eaf1:a18 with SMTP id 38308e7fff4ca-2ec0e60e0ebmr1915861fa.47.1718295958152; Thu, 13 Jun 2024 09:25:58 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240613162031.142224-1-longman@redhat.com> In-Reply-To: <20240613162031.142224-1-longman@redhat.com> From: Ard Biesheuvel Date: Thu, 13 Jun 2024 18:25:46 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] arm64/efi: Fix kmemleak false positive in arm64_efi_rt_init() To: Waiman Long Cc: Catalin Marinas , Will Deacon , linux-efi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Thu, 13 Jun 2024 at 18:21, Waiman Long wrote: > > The kmemleak code sometimes complains about the following leak: > > unreferenced object 0xffff8000102e0000 (size 32768): > comm "swapper/0", pid 1, jiffies 4294937323 (age 71.240s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [<00000000db9a88a3>] __vmalloc_node_range+0x324/0x450 > [<00000000ff8903a4>] __vmalloc_node+0x90/0xd0 > [<000000001a06634f>] arm64_efi_rt_init+0x64/0xdc > [<0000000007826a8d>] do_one_initcall+0x178/0xac0 > [<0000000054a87017>] do_initcalls+0x190/0x1d0 > [<00000000308092d0>] kernel_init_freeable+0x2c0/0x2f0 > [<000000003e7b99e0>] kernel_init+0x28/0x14c > [<000000002246af5b>] ret_from_fork+0x10/0x20 > > The memory object in this case is for efi_rt_stack_top and is allocated > in an initcall. So this is certainly a false positive. Mark the object > as not a leak to quash it. > > Signed-off-by: Waiman Long Acked-by: Ard Biesheuvel I'll take this as a fix via the EFI tree. Thanks, > --- > arch/arm64/kernel/efi.c | 2 ++ > 1 file changed, 2 insertions(+) > > 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; > return 0; > } > -- > 2.39.3 > >