Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3161415imm; Tue, 29 May 2018 02:05:17 -0700 (PDT) X-Google-Smtp-Source: AB8JxZohnA9Ty5oXX4TCt8fYT+27N0YxZKq3nb3cuLsAW+3b7CU8Cqi/0yFPCc20hxTryzmIZEcH X-Received: by 2002:a17:902:7008:: with SMTP id y8-v6mr16545087plk.141.1527584717565; Tue, 29 May 2018 02:05:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527584717; cv=none; d=google.com; s=arc-20160816; b=HWS/uibFMbhchW38nxxyUHb+0s/12XvvJimr44vuy8pWntSCn7clITkY8d5a/s9f2N BM89LqauvhesqsoKV7QEUtIn1A0MP/ekzhPxQ/FWuuwpIUlgTkn/Tx2LKV1s7GYbijK1 nAICQQTytaEHNU8tst3O8xz0ffMy6hdhL0Af9rigMVTQQybW7JLMwUzR7YA16XM0icrk FjARKer+yd5botxv9hMrS3pXoCcTzlRsQP4CyPJylRpu/rthcdCej77/v7DIgp2ME6jS Egsn4GNiG7acJeFU/qS8ULlmiteOW1QXRu0srMmC9ytamPTMZMiwJG9I0TYQUY5HCg6e +Awg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=8jTEFhveFgnCKUDLRF9KvYWcsIWLoXuvo0oZJcXlqug=; b=PhByfcAZzX0QGjDFJe7EfAskiFkee+ewveK/ftUuRZTOYy/DIRARnjogEXpAYoJGdT mdZ/oHl2uKuJRplvfZrdYeQDxLbfu4pAD1+O/+JhJ8lt5xOOkDg978DFP99uM9tArYKi oeGJOhWRj7uIsc0SB8pDv92FPPkj6nI7ltZK0O2W/CSNcw7ALZTuQxPxVTBEk7uF1BTh O3+FJBgph2bMza3xZrb1wKU8PZb5FrFOLsyVyamUT9kEY8QXcjC7T7oT3mhghNG+G6H6 ATBFS7Mq7TTwCf7G54EJLtXCSbmbn0i6XWnrZ9cwHZ2jQijDFEBnlRYmxOLzJn5h+Y/s xO4g== 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 j123-v6si33526919pfd.207.2018.05.29.02.05.03; Tue, 29 May 2018 02:05:17 -0700 (PDT) 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 S932553AbeE2JEc (ORCPT + 99 others); Tue, 29 May 2018 05:04:32 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:45354 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932288AbeE2JEa (ORCPT ); Tue, 29 May 2018 05:04:30 -0400 Received: from 79.184.254.169.ipv4.supernova.orange.pl (79.184.254.169) (HELO aspire.rjw.lan) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83) id aace52d4ae8ede43; Tue, 29 May 2018 11:04:29 +0200 From: "Rafael J. Wysocki" To: Larry Finger Cc: linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Erik Schmauss Subject: Re: [RFC] acpi: Declare memory allocations in acpi_ut_create_internal_object_dbg as non-leaks Date: Tue, 29 May 2018 11:03:43 +0200 Message-ID: <2350680.J6FZTH4xBM@aspire.rjw.lan> In-Reply-To: <20180512145938.7936-1-Larry.Finger@lwfinger.net> References: <20180512145938.7936-1-Larry.Finger@lwfinger.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Saturday, May 12, 2018 4:59:38 PM CEST Larry Finger wrote: > In kernel 4.17.0-rcX, kmemleak reports 9 leaks with tracebacks similat to > the following: > > unreferenced object 0xffff880224a077e0 (size 72): > comm "swapper/0", pid 1, jiffies 4294892358 (age 1022.636s) > hex dump (first 32 bytes): > 00 00 00 00 00 00 00 00 0e 01 01 00 00 00 00 01 ................ > 00 00 00 80 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace: > [<000000004f506615>] acpi_ut_create_internal_object_dbg+0x4d/0x10e > [<000000006e7730e3>] acpi_ds_build_internal_object+0xed/0x1cd > [<00000000272b7c73>] acpi_ds_build_internal_package_obj+0x245/0x3a2 > [<000000000b64c50e>] acpi_ds_eval_data_object_operands+0x17b/0x21b > [<00000000589647ac>] acpi_ds_exec_end_op+0x433/0x6c1 > [<000000001d69bcbf>] acpi_ps_parse_loop+0x926/0x9be > [<000000005d6fa97d>] acpi_ps_parse_aml+0x1a2/0x4af > [<00000000c4bef823>] acpi_ps_execute_table+0xbb/0x119 > [<00000000fd9632e4>] acpi_ns_execute_table+0x20c/0x260 > [<00000000e6ae17ac>] acpi_ns_parse_table+0x7d/0x1b3 > [<0000000008e1e148>] acpi_ns_load_table+0x8d/0x1c0 > [<000000009fc8346f>] acpi_tb_load_namespace+0x176/0x278 > [<0000000073f98b3b>] acpi_load_tables+0x6e/0xfd > [<00000000d2ef13d2>] acpi_init+0x8c/0x340 > [<000000007da19d8d>] do_one_initcall+0x46/0x1fa > [<0000000024681a1d>] kernel_init_freeable+0x1a2/0x237 > > According to gdb, the offending code is > object = > acpi_ut_allocate_object_desc_dbg(module_name, line_number, > component_id); > > As it is not possible to unload the acpi code to test that this is a real > leak and not a false positive, and that only these 9 appear no matter how > long the system is up, a kmemleak_not_leak(object) call is inserted. > > Cc: Rafael J. Wysocki > Cc: Len Brown > Cc: linux-acpi@vger.kernel.org > Signed-off-by: Larry Finger > --- > drivers/acpi/acpica/utobject.c | 2 ++ > 1 file changed, 2 insertions(+) > > diff --git a/drivers/acpi/acpica/utobject.c b/drivers/acpi/acpica/utobject.c > index 5b78fe08d7d7..ae6d8cc18cec 100644 > --- a/drivers/acpi/acpica/utobject.c > +++ b/drivers/acpi/acpica/utobject.c > @@ -8,6 +8,7 @@ > *****************************************************************************/ > > #include > +#include > #include "accommon.h" > #include "acnamesp.h" > > @@ -70,6 +71,7 @@ union acpi_operand_object *acpi_ut_create_internal_object_dbg(const char > if (!object) { > return_PTR(NULL); > } > + kmemleak_not_leak(object); > > switch (type) { > case ACPI_TYPE_REGION: > I've decided to apply this patch, thanks!