From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=74.125.224.135 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796457712; b=gQ5oGD5SLKPAxHG9ogdO/eM3tlbeu02ZoD+332ZwxoKNOp4y7d5+PdgKrY5HQY14KSZ/ don+bJeCKx4RvCdy7fAhNFLpAKuoiw8iW4Dm4YWdl8xBB92Q+gmxfoxbrz8V8/ekwCOXj KiOcpCjFRTjwGPPYyTipDEYLf9myeXIF81/GR4f4DGY7fe0OvabdOiVErXAiEeFUt5EQP yNmm6FBuIF/BsIHvMToeydu89UHilGODUS5j5XMr1hl28fmrPQL/oqcdrPD2SsbtsSngm vTxIcbWizL42uzISlm1qSRAi+BGUmCYXc4kgpZqf1Ie6hiEOvI5q5QnaidLckuCW2qw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796457712; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:In-Reply-To:References:Message-ID: MIME-Version:Content-Type:Content-Disposition:User-Agent; bh=ZPSZySkF5pUO/9msF0qVa4Kx3hhO4gluHyEsPQIasyI=; b=lmYmKnjhSMShFemrjnI2Jc7OTwjOrhksE8Ihw7ybRUfv9saBvbF5h79QT8Z22L0B74/L ySUAFKTCNrL55WdP4mVE+EaCUdvpWUSedsXbX1a4u+mijUA5A3teq0KjN3B/rSDr0tAEU 9srvlHEMfKi5ltvd43hU/5hKuMdtv8leyXCqZzj660aqnh0fAsES2Xo5Cqebb8eM91r5/ cuUtAH1Gqx2KRefC4VrEe1CnvOtaM9st/WNNnOf5k1wiphp/woN7zSXso/w0YZRWwHJiW 71Zg3T18wjEKTCkXS96lSfXpF8sJtHn5ljwIawDGM1I225hAzC+FDJLyNB4RnokBUgw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=chrisdown.name; spf=pass smtp.mailfrom=chrisdown.name; dkim=pass header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=JHsGxAbM; arc=none smtp.remote-ip=74.125.224.135 Received: from mail-yx2-f7.google.com (mail-yx2-f7.google.com [74.125.224.135]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 119B2606A322 for ; Sat, 5 Dec 2026 08:01:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 119B2606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chrisdown.name Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chrisdown.name header.i=@chrisdown.name header.a=rsa-sha256 header.s=google header.b=JHsGxAbM Received: by mail-yx2-f7.google.com with SMTP id 956f58d0204a3-67a3d39e406so688796d50.1 for ; Sat, 05 Dec 2026 00:01:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1796457711; x=1797062511; darn=vger.kernel.org; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=ZPSZySkF5pUO/9msF0qVa4Kx3hhO4gluHyEsPQIasyI=; b=JHsGxAbM2tto+T9VyazInjHkb1Vr1ZK026UBaqqqwNbSzh3vQGvd+IZ9f90JyAOVwP QRmcC+MLGf56+74KL0+hVkDPvfsZxJOXm5wmuy51qL2gqB5vb2Dr01a6MdacCeTXljlA aaJkZwNs6kONmabhoTsYpmEsiKcMxrHKqfvQ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796457711; x=1797062511; h=user-agent:content-disposition:content-type:mime-version:message-id :references:in-reply-to:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=ZPSZySkF5pUO/9msF0qVa4Kx3hhO4gluHyEsPQIasyI=; b=25dEXUpSZ8U/Kpt8CjVQp+648oQUUGevsjfP49DFglygp2Wh33VNC/FzgKiG7xyXpj Qsrc+tYlLpimE8GqISdIrSmNK6wXQLuLq/kyTXCriItCqpW0UsU1CxJ6JjUDmvXBeMGn sC9pZ4wZkKEOpPI58gD9b0XTJjDH568rcFsM7dtmHs1BDtq14SAbD34lUhxiGAyqcFhm VT1v4NhQndtsGhJA1vM5eQJB5ENyPVQn8lVIX2O1gOXdMtczLNrSAJo8j1s7E1ir0C2k ZXoiZOgjPK3dI93L+Ct8zSz0QynmWfUVVbbgCwwFI5S8uxqpe1Vz42ucwwUMwMB+e1nD JuIA== X-Forwarded-Encrypted: i=1; AL+hErEX87otjDIzvFA3GdfdI7b2G09IqKVGY+8XviiU71vsJc4lPswXe5RfWJtaIjopd2hlXs43Q5n9wDM=@vger.kernel.org X-Gm-Message-State: AB4q+uGUEHxg1KacTdcVyoijJ7xV2nFZusEpVu4s7/fCqDWJgllb7YpG +Nnc6sFXzV3FU+jCt1Su+Ai7/t8f099f2whPAF90Jx6CaVKiC1TUFtWgnuEd/QbwDNs= X-Gm-Gg: AZFdTZfp5l+10vc3i575/ooQdJrIIT2Jqw1eWrdeWeURLgsEpdMemOwNDpy5c1xkceo E3IK4m26FXZ7XCrkZORTByAlDoS0kRP7q/CNTR4IKNnMbboMv114ZveyppAX3KHa+lwNzJ8KL3k 4r4ln3wETgdicu8wrgmt++uzTOaPFOzQqXQ+UchZM0ztvICpzZy+ObF20LY8zW+2sxsMK5FOIrl i/6YHiwsToXSdIPzcBOquNokDymKR4MUcXTqkyLUGu4aKOnRwl1k55Zzam0sMcdi/qHMJuIHqI9 5y/aa/f+UHH2HGnCu349h5E1ZePFEwoUcSJ6uauBr4GxbsJfbA8AB8gtEDmmyC4mILP0V7E1Dd6 /lYElKd4TG3cMRO9kIbodkCZWxkWIxOICP1hGoqegoWcz0aONmcv/FP6kuA6CxI04BhJA+EL+Bh JiDrGqe1/TVc5kEsj3A4dgSzE2h7Ipr3LbMlKJOTG27K6Ekk0DCsM6CaUeMLDTWMFZBus6uB7Y0 GKxcNKe+F34LNfIxELzyX+n1kpyd27276PnmlXUG3y33N82n9s/NOeOhGi+X+spqFpiYO72CwFW 2k1G05b+up31uXCckYCvl0bu7QVTUJHRASxkvKVcwUxzJLV5DVmRo2GAc2K/JxAZ9Wxeee94S7s Jtc3vdmf5TU1PR90b21/yc7ASznWLEi6/pGhH/P6H2AlP4VnzHmLWlTkqM+l5PB7eJCGpcB7l3X 4TwxPDNReu9OvKbASiCxEP/g0bfVDuUFVlI/YNrCK9VAC5IsIXASM2Na5Xi+XdYiLeBEROmu018 u1iAzf+nTQpfUEWX57Qi98= X-Received: by 2002:a05:690e:4894:10b0:67b:f414:d8a1 with SMTP id 956f58d0204a3-67f7241357fmr1627124d50.56.1796457710837; Sat, 05 Dec 2026 00:01:50 -0800 (PST) Received: from [172.18.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 956f58d0204a3-67f0cd06396sm2134597d50.11.2026.12.05.00.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 05 Dec 2026 00:01:49 -0800 (PST) Date: Sat, 05 Dec 2026 00:01:46 -0800 From: Chris Down To: Harry Yoo Cc: "Vlastimil Babka (SUSE)" , Andrew Morton , Hao Li , Christoph Lameter , David Rientjes , Roman Gushchin , Kees Cook , Marco Elver , GONG Ruiqi , Jonathan Corbet , linux-mm@kvack.org, linux-hardening@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@meta.com Subject: Re: [PATCH v3 0/6] mm/slab: Support selecting slab hardening features at boot In-Reply-To: References: <8b6e489a-eb73-4b2a-ac65-dfadc8c73bfc@kernel.org> Message-ID: X-Mailing-List: linux-doc@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/2.4.3 (cc9e3943) (2026-10-09) Hi Harry, Harry Yoo writes: >For SLAB_FREELIST_RANDOM and SLAB_FREELIST_HARDENED, unconditionally >compiling in the feature has negligible overhead so we could instead >let them determine default behaviour instead of introducing _DEFAULT_ON >configs. Do you mean that slab_hardening= should be able to switch these two as well? Since v2 the series only makes them default y and leaves them as build time options, because their cost didn't show up at the system level and so there didn't seem to be a reason to switch them per host. I'd prefer to keep it that way for now. If someone does need that later, the list syntax means they can be added to slab_hardening= then. >For SLAB_BUCKETS, Vlastimil is working on making it less expensive to >enable at runtime (which is inspired by your series) >https://lore.kernel.org/linux-mm/20261203-kmalloc-entry-rework-v2-0-d718dc4fd906@kernel.org > > "If this is accepted, [1] should be rebased on it as it makes the > slab_buckets boot-time handling really straightforward. In fact > CONFIG_SLAB_BUCKETS could be repurposed to only control the default > behavior, while the code is always compiled in." Yes, that sounds good to me, and it's a lot nicer than adding another config option. I'll rebase v4 on top of Vlastimil's series and drop SLAB_HARDENING_DEFAULT_ON. I tried that on top of his v2, and it does make the buckets side a lot simpler. >For KMALLOC_PARTITION_CACHES I don't have strong opinion on having >_DEFAULT_ON flag for this, but I'd argue it's fairly reasonable to >assume it's on by default when it's compiled in, as compiling in the >feature has _some_ overhead already. Agreed, I'll keep it on by default when it's built in. Thanks! Chris