Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp2434472rwr; Fri, 28 Apr 2023 10:13:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5UXO0UEvycD3jKj9bHpMe+NtTKy7Z80LeDMm8v4MNihw7hc559T+h5M1tdrqLIzFk0VU1D X-Received: by 2002:a17:903:2308:b0:19e:ab29:1ec2 with SMTP id d8-20020a170903230800b0019eab291ec2mr6867520plh.65.1682702037563; Fri, 28 Apr 2023 10:13:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682702037; cv=none; d=google.com; s=arc-20160816; b=VIP1KJve7DKZ2znyL4smPP2jqFERFXG7+J6kHnrINoIxGHNwqvB7BtjhHSJByFLH5R trDnpwC+cRNLu6LW551N3RVNbw4HsTXK8a3k6o/eHb56l7DfqdQrmbf3g/mzR895ULHF zUIRn4qXrVQKBGe/T8v/XUT9YfR/LGpa3X/iVubb0RUbR+Q9oCFBNmDjyKvybi4LL/un wUIaNcGcXCx0iAsC7qTUxEYue5I2+wJJtCRqSzSUjpXD3en77alSYfk2iwUS8N/ZAVyj LToSWDmQ0YnYWPunRMIWtbl2i9PDLdSE0cTq1U82SZ+ztZcaEXkdDmsjqjs71jAfqhYp 55ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=Dv4VJUZKnl4kkF46naPfmIUVcZoylXdHGW8K+eCiq7s=; b=m3yZtr5I4JzMHk8QQwFqPnu6agv5JkSy8RgBHS+3UMvzN2oKI8X2aaX7T7LbCIa9CX xFxDZehdggkYx9CzT4GNqJOQ5sFkjNXMXLVvY+aYB4P4GKQJBjardtD9++wWOU+XUKH7 9mWddPupukMozmAGD7xT9ajLlC2kokXademtAPC5HOYrnIW5asqHL0Vy3GcxxwoNqsAS PbuGTNBFwczhtxs8KMrt+0wj52Vv2+Up+zIWmZFalxA2NMht6Grdk3q7xnFRXmUR6cS1 Kz1J1v/6mrm9fC5VMYdU0vIeto5wDH6khkDQzPC+mWu6WMuI7aktGCtCGSw9VldaeQNC juQQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id p8-20020a170902e74800b001a51bb4ad7dsi20492698plf.45.2023.04.28.10.13.44; Fri, 28 Apr 2023 10:13:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345994AbjD1RMB (ORCPT + 99 others); Fri, 28 Apr 2023 13:12:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47216 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345699AbjD1RL7 (ORCPT ); Fri, 28 Apr 2023 13:11:59 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B881826B2 for ; Fri, 28 Apr 2023 10:11:58 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 54A9660F7E for ; Fri, 28 Apr 2023 17:11:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1627BC433A0; Fri, 28 Apr 2023 17:11:56 +0000 (UTC) Date: Fri, 28 Apr 2023 18:11:54 +0100 From: Catalin Marinas To: Jim Cromie Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] kmemleak-test: drop __init to get better backtrace Message-ID: References: <20230425222446.170486-1-jim.cromie@gmail.com> <20230425222446.170486-4-jim.cromie@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230425222446.170486-4-jim.cromie@gmail.com> X-Spam-Status: No, score=-6.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Apr 25, 2023 at 04:24:46PM -0600, Jim Cromie wrote: > Drop the __init on kmemleak_test_init(). With it, the storage is > reclaimed, but then the symbol isn't available for "%pS" rendering, > and the backtrace gets a bare pointer where the actual leak happened. > > unreferenced object 0xffff88800a2b0800 (size 1024): > comm "modprobe", pid 413, jiffies 4294953430 > hex dump (first 32 bytes): > 73 02 00 00 75 01 00 68 02 00 00 01 00 00 00 04 s...u..h........ > 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ > backtrace (ck 603070071): > [<00000000fabad728>] kmalloc_trace+0x26/0x90 > [<00000000ef738764>] 0xffffffffc02350a2 > [<00000000004e5795>] do_one_initcall+0x43/0x210 > [<00000000d768905e>] do_init_module+0x4a/0x210 > [<0000000087135ab5>] __do_sys_finit_module+0x93/0xf0 > [<000000004fcb1fa2>] do_syscall_64+0x34/0x80 > [<00000000c73c8d9d>] entry_SYSCALL_64_after_hwframe+0x46/0xb0 > > with __init gone, that trace entry renders like: > > [<00000000ef738764>] kmemleak_test_init+/ Acked-by: Catalin Marinas