Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp10889484imu; Thu, 6 Dec 2018 08:18:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/W54EJ9FoCbf3r4oXVPb5Wg32fDZXpMf6CwK7la60CZg3e40EweQQ3cxw7fnaZC1GMyhV/x X-Received: by 2002:a63:5f41:: with SMTP id t62mr24730566pgb.76.1544113121540; Thu, 06 Dec 2018 08:18:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544113121; cv=none; d=google.com; s=arc-20160816; b=uC9gCpk/Pg6iS0kvJu9Bw0kIZWgeKR2lx/Li3H4rCL7h0Ghzu5SE624fg+YR9JC0dm GWOlOBGghDJVUmjbxKDLBUtrk81aKtlE+tAgfEQ1SNSPngLiU66fN5puOMkiTQ9vcLoK 0D0fREXbz21U5QoACIOEcSznH3OiQTK/rhU3XWIxgZqJBTYNxHMk4rjQXXTqzE3fWOmz 4BWflwukXx7wGZG6Js5l8OWwu/+8y8HAGNRXiGJNaVmgocOdI9r6qomtw8Lte2j3waHE G5bOq50oqb7f3m5O6WG/mXC57BwkTfCq2GQNGvMoQdueRL54tIpADhZjbUfJz6OBN234 RuPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=AwdfnTCvociQB7Zeup13CcqO5MvZVQ7mn3zC0yjHilI=; b=MLIBEXsPV3jNe8xuOFwnioEdirYLSIsYgDnY4q4d/PDIT9ZT1986QEb34jDy7f+w6P a9GOs2AZggb2Ba0YFV1w2wHNJSpv8GKtOTK5WjnH0PQ5wt+iOoV6oUuS2E/9xeLplxep WNAk0nnYCfFzjIeilv/3BqkUB2RGC5oVKdVa6WYjTICbsQdtzgLZVzs33udV5JDBUhHN UNgQPyPaN4ScPBt0gSmqMi0inGgNLtGAgKFg8Ou3Yztd5530dL+COHVMldFT//R082ij pOR8+KylzTGa7hPH0uuKq18snysDBpHZYePcxq3M1jBesPkl0j/2sZvncDLYT8e2fObb n7wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q5si514264pgb.245.2018.12.06.08.18.03; Thu, 06 Dec 2018 08:18:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726079AbeLFQRI (ORCPT + 99 others); Thu, 6 Dec 2018 11:17:08 -0500 Received: from mout.gmx.net ([212.227.17.21]:45001 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725922AbeLFQRH (ORCPT ); Thu, 6 Dec 2018 11:17:07 -0500 Received: from ovpn-121-90.rdu2.redhat.com ([71.184.117.43]) by mail.gmx.com (mrgmx103 [212.227.17.174]) with ESMTPSA (Nemesis) id 0MYwQh-1gzzcp0sJ1-00VkjW; Thu, 06 Dec 2018 17:17:04 +0100 From: Qian Cai To: akpm@linux-foundation.org Cc: ard.biesheuvel@linaro.org, catalin.marinas@arm.com, marc.zyngier@arm.com, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, Qian Cai Subject: [RESEND PATCH] efi: let kmemleak ignore false positives Date: Thu, 6 Dec 2018 11:16:33 -0500 Message-Id: <20181206161633.36292-1-cai@gmx.us> X-Mailer: git-send-email 2.17.2 (Apple Git-113) In-Reply-To: <1543517152-23969-1-git-send-email-cai@gmx.us> References: <1543517152-23969-1-git-send-email-cai@gmx.us> X-Provags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j2ri7vN990owVLyg92o+4+7q5Zt2LiD2oSziDtTkQ7f1w2 cxH/+0t+xLa8KWRYFTdxHcF9dkx2g39BhlurKAogU6YmW3FesbSLiRiegamZfzU3xPFe7uOI9 xsGEVCk2gNCWUJ57/miPZsrQj2V8u0hyoq4DoMf0E= Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org unreferenced object 0xffff8096c1acf580 (size 128): comm "swapper/63", pid 0, jiffies 4294937418 (age 1201.230s) hex dump (first 32 bytes): 80 87 b5 c1 96 00 00 00 00 00 cc c2 16 00 00 00 ................ 00 00 01 00 00 00 00 00 6b 6b 6b 6b 6b 6b 6b 6b ........kkkkkkkk backtrace: [<000000001d2549ba>] kmem_cache_alloc_trace+0x430/0x500 [<0000000093a6dfab>] efi_mem_reserve_persistent+0x50/0xf8 [<000000000a730828>] its_cpu_init_lpis+0x394/0x4b8 [<00000000edf04e07>] its_cpu_init+0x104/0x150 [<000000004d0342c5>] gic_starting_cpu+0x34/0x40 [<000000005d9da772>] cpuhp_invoke_callback+0x228/0x1d68 [<0000000061eace9b>] notify_cpu_starting+0xc0/0x118 [<0000000048bc2dc5>] secondary_start_kernel+0x23c/0x3b0 [<0000000015137d6a>] 0xffffffffffffffff efi_mem_reserve_persistent+0x50/0xf8: kmalloc at include/linux/slab.h:546 (inlined by) efi_mem_reserve_persistent at drivers/firmware/efi/efi.c:979 This line, rsv = kmalloc(sizeof(*rsv), GFP_ATOMIC); Kmemleak has a known limitation that can only track pointers in the kernel virtual space. Hence, it will report false positives due to "rsv" will only reference to other physical addresses, rsv->next = efi_memreserve_root->next; efi_memreserve_root->next = __pa(rsv); Signed-off-by: Qian Cai --- drivers/firmware/efi/efi.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/firmware/efi/efi.c b/drivers/firmware/efi/efi.c index 415849bab233..7fcfe8a7ae98 100644 --- a/drivers/firmware/efi/efi.c +++ b/drivers/firmware/efi/efi.c @@ -31,6 +31,7 @@ #include #include #include +#include #include @@ -1000,6 +1001,8 @@ int __ref efi_mem_reserve_persistent(phys_addr_t addr, u64 size) if (!rsv) return -ENOMEM; + kmemleak_ignore(rsv); + rsv->base = addr; rsv->size = size; -- 2.17.2 (Apple Git-113)