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 153D5C27C4F for ; Fri, 14 Jun 2024 02:43:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B938A6B00D7; Thu, 13 Jun 2024 22:41:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id B1B786B00D8; Thu, 13 Jun 2024 22:41:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 9C4E96B00D9; Thu, 13 Jun 2024 22:41:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 79A7A6B00D7 for ; Thu, 13 Jun 2024 22:41:08 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 1F109A1715 for ; Fri, 14 Jun 2024 02:41:08 +0000 (UTC) X-FDA: 82227942216.07.75CD846 Received: from out-174.mta1.migadu.com (out-174.mta1.migadu.com [95.215.58.174]) by imf17.hostedemail.com (Postfix) with ESMTP id 7942040002 for ; Fri, 14 Jun 2024 02:41:03 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Kxcz1kUS; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf17.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.174 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1718332864; a=rsa-sha256; cv=none; b=8YCNaV88Pgn1XVogaZAupgz5htWmnrkftiWBH1Aw1/XTCOngUxZhHfa9aBacDLowbBp1wi sdgTwTM31NKS9LyqKAl8/dwuRmpNmCEH9yQTtznRFoITSoiwOdaWoXCpuvz8iLl8WRMcM3 e6br/l0Mimjj1i4h2HNFoobXc+xA7Ns= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=Kxcz1kUS; dmarc=pass (policy=none) header.from=linux.dev; spf=pass (imf17.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.174 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1718332864; h=from:from:sender:reply-to:subject:subject: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:dkim-signature; bh=pDP8QkqOpKi3HPcns5zN8G1TVuK/krfhjPMkmuwufGs=; b=Cr2oQYxodozdn0DL25lX699lNhKdkKpzbOZhhJwHts3ymRZezaAZln1BC7bt4oWCji3oZ3 w723TjDNdixAJXzEfxsiCKpONAofhLxGExbeKGH8q0Cc59IwrAUX/svyyvYtckMHKTdFts 8dH/OZ0zEgvo6+qKWOnG5+J98Y0Gv9M= X-Envelope-To: cl@linux.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1718332861; h=from:from:reply-to:subject:subject: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=pDP8QkqOpKi3HPcns5zN8G1TVuK/krfhjPMkmuwufGs=; b=Kxcz1kUS0fkwCaOceMft90t1ewiDpACo6h3YKW/j2WAPP4avGFQG2OkaglRdqa/jFHNobI z76GooYflJxxh9rp2IAusp2D/S57X9JjZSraBbNMKscpVHnLRui1/cAI7XxhCr6e8AGWRO rS7PePNf4/dLfNEwwcj44dqEWZWza9s= X-Envelope-To: vbabka@suse.cz X-Envelope-To: penberg@kernel.org X-Envelope-To: rientjes@google.com X-Envelope-To: iamjoonsoo.kim@lge.com X-Envelope-To: akpm@linux-foundation.org X-Envelope-To: roman.gushchin@linux.dev X-Envelope-To: 42.hyeyoo@gmail.com X-Envelope-To: feng.tang@intel.com X-Envelope-To: linux-mm@kvack.org X-Envelope-To: linux-kernel@vger.kernel.org X-Envelope-To: zhouchengming@bytedance.com X-Envelope-To: keescook@chromium.org Message-ID: Date: Fri, 14 Jun 2024 10:40:30 +0800 MIME-Version: 1.0 Subject: Re: [PATCH v3 1/3] slab: make check_object() more consistent Content-Language: en-US To: "Christoph Lameter (Ampere)" , Vlastimil Babka Cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , Hyeonggon Yoo <42.hyeyoo@gmail.com>, Feng Tang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, zhouchengming@bytedance.com, Kees Cook References: <20240607-b4-slab-debug-v3-0-bb2a326c4ceb@linux.dev> <20240607-b4-slab-debug-v3-1-bb2a326c4ceb@linux.dev> <63da08b7-7aa3-3fad-55e6-9fc3928a49de@gentwo.org> <8b844d71-01f1-472b-a63a-4c9cdb26e9ef@suse.cz> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Rspamd-Queue-Id: 7942040002 X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: hubjoe574hhxwwmp6xnop68s5hnaqryd X-HE-Tag: 1718332863-369824 X-HE-Meta: U2FsdGVkX1+eFWxoGR3+fpuspCPYNAlhASDpdT1Z9zy+UMQnNYoei0pd+BsOCpHJkPKcR2QxDGjTMkvPzPGeZ5/vTLSfutij5HWARLT3U3R1BHMwbR78OT08AaT4EWBK7+yeIlBR0Oeo4IJirbCbA+B3aG+LzqNVQc9tU7ErWK6vNo7hwOvMKBG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ogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2024/6/12 06:52, Christoph Lameter (Ampere) wrote: > On Mon, 10 Jun 2024, Vlastimil Babka wrote: > >> Even if some security people enable parts of slub debugging for security >> people it is my impression they would rather panic/reboot or have memory >> leaked than trying to salvage the slab page? (CC Kees) > > In the past these resilience features have been used to allow the continued operation of a broken kernel. > > So first the Kernel crashed with some obscure oops in the allocator due to metadata corruption. > > One can then put a slub_debug option on the kernel command line which will result in detailed error reports on what caused the corruption. It will also activate resilience measures that will often allow the continued operation until a fix becomes available. This reminds me that we can't toggle slub_debug options for kmem_cache in runtime, I'm wondering is it useful to be able to enable/disable debug options in runtime? We can implement this feature by using per-slab debug options, so per-slab has independent execution path, in which some slabs with debug options enabled go the slow path, while others can still go fast path. No sure if it's useful in some cases? Maybe KFENCE is enough? Just my random thoughts. Thanks.