From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.170 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1795929677; b=uw/h9jGtWf6ullA69jyHYRVzhBcRve6/A6u5FNhQ66fwdrETnj+TDAJByWY3t5QE8ggM nmeEbeexbj3nKkv5G04za9Le5YU2v8bL+Rit9cQy1+3OwLxYoBj6nqHv4CFsa/hT8MJ44 wQ0umOKhboUkjA6oQ7N5RLICfMk4yV6f0W2PoWDoDvoSMKJRHnfBP6Joiu0urgATLA/IF H6Kjuk2NA4IuhFWan7RP2xc9FKVo4PHX0MdtkFd5tlsqpzJ/hnyo7uIodmd2FpIIfgs52 bcy3y/0vU/pYghaFX1TcZR8j2V1x4lVkNrMAyGfLPplVTOWxCupkdwOM6gCXc148EVg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795929677; 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=IYw01PHk9RMJHthy0gSw6B5M2B+JQ+uuoFp5Y+I2ldw=; b=xbKs4MoJytZVjcQHGuZnXOOskiem7cxoP92fZfEDcJkfKNEF8jTRAlpaLhT82439Qt09 HJBoZVMX6SQIS7vDB6BWpusAMktfBaNcuSI3BX6XGhnMUjzBaERJOjPPA1eOrJHFjpU/l eo6xVPpidBVX4uRE5sImd6VvrLPds6fvzHCXR8gDvRzM2AJSzkJTaHuK5Z0iEADwSqUjL cmDsxyByh8tHZtKP0I17jTXWk6QvvYLSPFVNyh6auvjkp9vCPFn+ZRzuvSuAW4E6grtsm hJDNXavJrIpF+qgjdhmkJnI0dk5/ELQ8zJipSeNsDh1oPtYCzAnU8x7WAPab+Xk6EhA== 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=d+zIH1gi; arc=none smtp.remote-ip=209.85.128.170 Received: from mail-yw1-f170.google.com (mail-yw1-f170.google.com [209.85.128.170]) (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 B9645606A324 for ; Sun, 29 Nov 2026 05:21:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B9645606A324 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=d+zIH1gi Received: by mail-yw1-f170.google.com with SMTP id 00721157ae682-8b4dd5cb4f6so65975927b3.2 for ; Sat, 28 Nov 2026 21:21:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chrisdown.name; s=google; t=1795929676; x=1796534476; 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=IYw01PHk9RMJHthy0gSw6B5M2B+JQ+uuoFp5Y+I2ldw=; b=d+zIH1gistEn9Lf4sWXtblv+FQDla505gAsnclvgiuRdrPUMsAzFlaTunpjhy9VBaG H5oExXO+o1+/u2JfILKACTuGV0R8p3pwxUJD/5fBsImzqxo9mXVktPyOroT50W3ACI86 Chw68pLe61ckx25EcnciU5nA/4ufn3O9cHq9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1795929676; x=1796534476; 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=IYw01PHk9RMJHthy0gSw6B5M2B+JQ+uuoFp5Y+I2ldw=; b=2t45O44Ge5zFiTQyRDbCNUPmXckJFT2TQEpOemC29KyF+X6xYtd4SNSJ2pcMNXZzeF 4Z0Ne6mgxSF8VcZw/yZkluja+iQ8q3GjfFiHqgISfl9HCRE6RtF45O3u1iCGmUzS1VlE mZmekBKz8Lgg9HCowleFVB20DkFRv4I328Nf17XzGTALZzKsFIGTf3qxN7Xd4Lcr5IHr uQkey0DQXsuiOQVrigbfOq26Wfejd1HjNQos4Ik/N1R2Y/GuwruAQNVssL4pq3IizGvH H3ACqiGVRoLnL4T5G2M1lZuWodzsXKsL4tFHGECaZQwi6DJzXSfTCXJ7VU5XMwy31ALA SWIw== X-Forwarded-Encrypted: i=1; AL+hErEjM/MpIUh0fStr137GAwjHjQ37q7KOw00TtSI7rcNeOXfhIFtUv4Yvygld46Wclb7+gSBbGJbqwnd6/q8=@vger.kernel.org X-Gm-Message-State: APuU4Z9du6f0+1wlopG7hU8B1LTJ8O5GQE5b3yUyRD+touLi3M714YK2 Wl1wh8RsUxEAkdF2SgLrYWXHy7/zliLMK1dwGJicmcy5Cv+BxkObe33KiHcKo4vyuUA= X-Gm-Gg: AZFdTZeOpYKM4l0PggHjaOWR9Dr3dkAhM66e4bHhkU/YzSqjKBafzZeHsw1KPNSdHQ/ Eq/KSpwsM1Jn8PlQaLk0SYyqXb4Na3aApLGn7kPhnNb2/7Hct3jTbtdCjZfzxDOpckBQivTGq1h IMXcqU7eLH3Xpt3FlkApVBksnmpX912LREYTYpBoxUdDiJgsMNC3hMuSve2w0Q5jw8Tp9uH68Qr C8M3cpVuiLWoKnEp870Bp7uVAgGbQ3bgmC6vzI4CMBQQ3iYMPTn9bN8dBLJiKTfTyyiuqvvu9DN kHJR84BaaQfTjXesqAITKUwAp9Ht/jKLwbNf4rHFqyBtGNTxvCyMBCT1ZuZci5S5VbSrMOd/DqP 8Hbn8mU4ak6R0l5h6awhg6JjN55V364oWLfE6M5Fp2uEDCNTamiMQn1wrP0JqLX3JnPttZEeWpV guA4aTcJ/l2iDIOeDeUT3WqGTPENpnkVYOGHvmiTUIAuG9MCtznsbUYH7FmLdzDnrsj4pbYSuBI eAow5Pw0EMX3Zo4bJYSbgn69pLMqS+UHKsARWHSChCSV98uugdgf3Z57Bn34YNmGvGyYqR8GPWY /H8gGir3QLaaCn4Fi3Le0xaqqk/qB5Y3dP40IX++F7ZbXLA14E8Mvlig8YhzpCByacCyOudVbfv WWgBPWFBhpw4D6kcvkATrEI9sNj4PLuh+V3dFgJvjRoYlBvedwuHQv0bphYcEmNvglbrTDSyvOf 8vvujxxhxo/PVDQJ4P1WkuQbsDZDR1xwG8L8yyEcjj62Gx9Jl6NDsyOSqjd22fwGa18OcqbLbDv SJdH7mDVJWCL/8/PZQdZpU= X-Received: by 2002:a05:690c:c9b:b0:8b4:d8f4:8cba with SMTP id 00721157ae682-8b5205041d4mr136900727b3.59.1795929675921; Sat, 28 Nov 2026 21:21:15 -0800 (PST) Received: from [172.20.0.2] (c-73-207-185-9.hsd1.ga.comcast.net. [73.207.185.9]) by smtp.gmail.com with ESMTPSA id 00721157ae682-8b520309d3esm113870017b3.30.2026.11.28.21.21.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 28 Nov 2026 21:21:14 -0800 (PST) Date: Sat, 28 Nov 2026 21:21:11 -0800 From: Chris Down To: "Vlastimil Babka (SUSE)" Cc: Harry Yoo , 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: <8b6e489a-eb73-4b2a-ac65-dfadc8c73bfc@kernel.org> References: <8b6e489a-eb73-4b2a-ac65-dfadc8c73bfc@kernel.org> Message-ID: X-Mailing-List: linux-kernel@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 Vlastimil, Vlastimil Babka (SUSE) writes: >I'm not thrilled about the "default to on". We usually do these features >opt-in. Now our distro kernel would likely need to have these "disable this" >options in the default command line, with documentation to remove it for a >hardened setup. > >But yeah doing it opt-in, the hardened setups would now have to start >passing the extra params to enable this, even if until now enabling the >config option was enough. Also not great, but we can argue they are still >the minority? > >Of course there's always the possibility of adding another _DEFAUT_ON >configs. Not great either. Sigh. Yes, it is ugly. Given that Harry asked for one of those [1], how about a single SLAB_HARDENING_DEFAULT_ON for both features in v4? With it set to n, a distro kernel can build them in and a hardened setup only needs to add slab_hardening=on (slab_hardening= will replace slab_buckets= and kmalloc_partition= in v4, as Marco suggested [2]). It can still default to y in order that existing configs don't quietly lose these features. The downside is that SLAB_BUCKETS defaults to SLAB_FREELIST_HARDENED, which this series makes default y, so a defconfig kernel would get the buckets built in and on at boot. Or would you rather have n anyway, with hardening.config setting it to y? Thanks! Chris [1] https://lore.kernel.org/r/avdbfEfQHpF9Ez-e@thinkstation [2] https://lore.kernel.org/r/CANpmjNP0cWB_670hYj7p+Dd=do1qEu4XHeW+c7sTv-MXi0UBTg@mail.gmail.com