From mboxrd@z Thu Jan 1 00:00:00 1970 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id A8795C433EF for ; Thu, 7 Apr 2022 09:43:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3DCAC6B0071; Thu, 7 Apr 2022 05:43:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 38D066B0073; Thu, 7 Apr 2022 05:43:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 22D3C6B0074; Thu, 7 Apr 2022 05:43:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 10F8D6B0071 for ; Thu, 7 Apr 2022 05:43:44 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id C92C920DBD for ; Thu, 7 Apr 2022 09:43:33 +0000 (UTC) X-FDA: 79329595506.06.56C4F11 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf05.hostedemail.com (Postfix) with ESMTP id 2372D10000A for ; Thu, 7 Apr 2022 09:43:32 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id A4F0721118; Thu, 7 Apr 2022 09:43:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1649324611; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vVYoOYaAx4Gi+k6jmKcQlAmR+lRXy3fsIaZR5iuwl9o=; b=n9ckxMvlVnFwcq5YUHMGb7FSTo8TxgmggjiMV+voqPQC36OAVentx1tlQZshmczFvzBVlB YtFTVGD4YNWVZytInV5M2adiX1HEgig2hWnuaddwMsTDz+UCPP2cjM8l1SwZ+qxOr3x7Jc 30md0akcgu+q+7U5NpwPOSy9pu6uKww= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1649324611; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=vVYoOYaAx4Gi+k6jmKcQlAmR+lRXy3fsIaZR5iuwl9o=; b=7piVvb26/htTn6M/4zPsX6E3WzRzt0HixBsPd3A3bjXxO7kzilrvW5FGdMMWgHXQ7H344K nbhmMBNAyUXDfsBQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6EB7A13A66; Thu, 7 Apr 2022 09:43:31 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id nVgvGkOyTmL5MwAAMHmgww (envelope-from ); Thu, 07 Apr 2022 09:43:31 +0000 Message-ID: <4b592848-ef06-ea8a-180a-3efc22b1bb0e@suse.cz> Date: Thu, 7 Apr 2022 11:43:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] mm, kfence: support kmem_dump_obj() for KFENCE objects Content-Language: en-US To: Marco Elver , Andrew Morton Cc: Alexander Potapenko , Dmitry Vyukov , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Roman Gushchin , kasan-dev@googlegroups.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, kernel test robot , Hyeonggon Yoo <42.hyeyoo@gmail.com> References: <20220406131558.3558585-1-elver@google.com> From: Vlastimil Babka In-Reply-To: <20220406131558.3558585-1-elver@google.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2372D10000A X-Stat-Signature: 1wmwz9s6zr6b6x8k39cfj37u8rdhnt5w Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=n9ckxMvl; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=7piVvb26; dmarc=none; spf=pass (imf05.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz X-Rspam-User: X-HE-Tag: 1649324612-221202 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On 4/6/22 15:15, Marco Elver wrote: > Calling kmem_obj_info() via kmem_dump_obj() on KFENCE objects has been > producing garbage data due to the object not actually being maintained > by SLAB or SLUB. > > Fix this by implementing __kfence_obj_info() that copies relevant > information to struct kmem_obj_info when the object was allocated by > KFENCE; this is called by a common kmem_obj_info(), which also calls the > slab/slub/slob specific variant now called __kmem_obj_info(). > > For completeness, kmem_dump_obj() now displays if the object was > allocated by KFENCE. > > Link: https://lore.kernel.org/all/20220323090520.GG16885@xsang-OptiPlex-9020/ > Fixes: b89fb5ef0ce6 ("mm, kfence: insert KFENCE hooks for SLUB") > Fixes: d3fb45f370d9 ("mm, kfence: insert KFENCE hooks for SLAB") > Reported-by: kernel test robot > Signed-off-by: Marco Elver > Reviewed-by: Hyeonggon Yoo <42.hyeyoo@gmail.com> Thanks. Given the impact on slab, and my series exposing the bug, I will add this to slab tree. Vlastimil