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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 519D4C05027 for ; Thu, 26 Jan 2023 11:29:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236632AbjAZL30 (ORCPT ); Thu, 26 Jan 2023 06:29:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42510 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237038AbjAZL3X (ORCPT ); Thu, 26 Jan 2023 06:29:23 -0500 Received: from gentwo.de (gentwo.de [161.97.139.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A12B25C0C9 for ; Thu, 26 Jan 2023 03:29:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.de; s=default; t=1674732529; bh=MjeJA3NTnp7VBIpasqh8v6gjDuTw3unVXYc5oF/te00=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=hTW/HzhEHDw08AypQ8JO9SLQYHba1iZboqg7mongU/LCdGcy0LIkDnwxRwdy88v5U AmZAYk5TgR1OzOJg3RZVHwZkhgctKYX6DXKBJJpJpCANkqDnUIa3xl1Ew61e38Gutx sbJo2/hEv5HKK3xPURdyQ26pqKLpKFJsQvfcw+8o166pz3utFATNO5GSdOxt6bzUMe j4XnwUVjjsnigx1yIiH7xer/waHNiSXAfj3nBHLOTFBpqgPN9DYLyL/M6hdYq1DHch +Y64B9NTk8zLbPf93dc25uqzGQYObUlC8jGWecVfp6f1bh97w2GM43Z8rUoyLvAVLG 0Vh3uLv4I1bCA== Received: by gentwo.de (Postfix, from userid 1001) id 1165AB0028E; Thu, 26 Jan 2023 12:28:49 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by gentwo.de (Postfix) with ESMTP id 0E4FDB00137; Thu, 26 Jan 2023 12:28:49 +0100 (CET) Date: Thu, 26 Jan 2023 12:28:49 +0100 (CET) From: Christoph Lameter To: George Prekas cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Catalin Marinas , Andrew Morton , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Thomas Gleixner , "Eric W. Biederman" , Sebastian Andrzej Siewior , Andy Lutomirski , Peter Zijlstra , "Liam R. Howlett" , Fenghua Yu , Andrei Vagin Subject: Re: [PATCH 7/9] mm: kmemleak: erase page->s_mem in slab_destroy In-Reply-To: <20230123170419.7292-8-george@enfabrica.net> Message-ID: <73309bf-ca5b-b0ba-8ac-4be7dcc278b7@gentwo.de> References: <20230123170419.7292-1-george@enfabrica.net> <20230123170419.7292-8-george@enfabrica.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 23 Jan 2023, George Prekas wrote: > The field s_mem of struct page is initialized with the virtual address > of the page in function alloc_slabmgmt. If kmalloc allocates an object > that starts on this page, then kmemleak knows that this object has 2 > references. On slab_destroy, s_mem should not continue referring to any > allocated object in the future. Nope. s_mem is a pointer to an array of objects. It is not a pointer to a page. If a slab-caches is used for slabmanagement then these objects contain slab metadata which may be a bit confusing.