Received: by 2002:a05:7412:37c9:b0:e2:908c:2ebd with SMTP id jz9csp818717rdb; Tue, 19 Sep 2023 11:00:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG3so3sq4bbv4QIOkmdb/XZ8HDplMkTXz8Q+Q5RP945l27dx5pdlwGsqQFxtd7edjLLxfj5 X-Received: by 2002:a05:6a00:9a0:b0:690:d413:ee0f with SMTP id u32-20020a056a0009a000b00690d413ee0fmr493900pfg.2.1695146441292; Tue, 19 Sep 2023 11:00:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695146441; cv=none; d=google.com; s=arc-20160816; b=Z5vZyrjWnWUySNGcumxtohD+qGgFxN1zXbnyB+5mMYrECrlJ29xEwKIDLYXZWrZkMs PhMFOcGwdDFtTGoV0YRmZFd0rpSbOmGTmm3d+qTfsTjUhKCJjRb5+sfZuAQyZROT7EV8 OZCvyqjuIOxM/Y+SCvtCm5ygNnMm+a8XuqAJDsl+9r2iWORGU89dvtW+m/H18v4UlVyw 42d4kw7poWPXZIH0Ofl05qDbEpy6Zr62MTpn3hletP9rakLlR0YFotIB1QGh82aJNLoM bd0F4kMupLxNNNUButI0hupd2EqTGwRhQwn1gJMzXt75s77z7RovYbZDrs/eHJ4Smj+K 3esA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:references:in-reply-to:user-agent:subject:cc:to:from :date:dkim-signature; bh=zO2aiQAm4ec6lkECnrKY0h5EcMZuuMJTfA1OIy7/eK4=; fh=NmLRlfOI8dEa4D/b7i83XcwoeXE2eXGnTzhWMmXNHLA=; b=zlzSnT7gS27pFBpZHOTcNtzSUNtNhNO/EYZgqE2eLSR8oZ6OoWlVU8RDQqYXK++Xj7 84sR3H6aL9Wf/vT8AwEIaOX9vwZO2u6CwokoDrRIi1zStcN1i6tYG3YG3XDPivM7s8JY 2NkevCtYyhLf2XyOdUgCmn6rHgh9T8fscJyf6xqh9HKTEmQ34dmd6SctjdnntGrBRMew jDsJ0YIzJx5tA2Mtlkvp7ZiAfkjFVGekjTCCqIYplcXvnYmBDwx/hj7fJI5AcrgLDun2 QCjDkpdp1tDnCA+1y+cL8FvCeOF3JwwA105t4Qia9g/xs05dGRFM1MjiV/QA8HSbDvpm p+3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XLFPSlnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id a12-20020a62d40c000000b0068fc9557cddsi1483676pfh.81.2023.09.19.11.00.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Sep 2023 11:00:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XLFPSlnv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id B90CA8076D2A; Tue, 19 Sep 2023 10:56:40 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232828AbjISR4j (ORCPT + 99 others); Tue, 19 Sep 2023 13:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35524 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232808AbjISR4i (ORCPT ); Tue, 19 Sep 2023 13:56:38 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB7C5A6; Tue, 19 Sep 2023 10:56:32 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32C8EC433C7; Tue, 19 Sep 2023 17:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1695146192; bh=oTw5IJcJ7n9tX0eMkW/N8Wz1esHYNZcEC42vs2lJXvE=; h=Date:From:To:CC:Subject:In-Reply-To:References:From; b=XLFPSlnvSySUE75ZgJvK7r8LybpP+ITsN9JtmBGN6EMLqQ2W1A7Ej1jHgZg+f8J86 RZPgO15umwMmwDOfWjUoLHbUcxxJkDLD7EtjO2CyQYaT2AHNgMajuzciDetfw1hKNX HqQqI3N5SreMRdLI43zCtjAfTgRWJSVMSqqmsKw7MvXP1AjkJrW3Y2K0rfa6IOyg+W UZhRvKxUeKOTEbcuIGDSIa1wQkoY9MdVjUBP5hgBnOeCQxiGF3nvd1jlbDblEOXUnn Vl7gRXEjSWgSLt5s/0OlNOpmkV7LiNq4PU5hVbOaHwEK/QLU23W5CCw1xzhsP+wRNc OeCwbk6WH+wBQ== Date: Tue, 19 Sep 2023 10:56:30 -0700 From: Kees Cook To: Dave Hansen , Matteo Rizzo , Linus Torvalds CC: Ingo Molnar , "Lameter, Christopher" , penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, keescook@chromium.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-hardening@vger.kernel.org, tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, dave.hansen@linux.intel.com, x86@kernel.org, hpa@zytor.com, corbet@lwn.net, luto@kernel.org, peterz@infradead.org, jannh@google.com, evn@google.com, poprdi@google.com, jordyzomer@google.com Subject: =?US-ASCII?Q?Re=3A_=5BRFC_PATCH_00/14=5D_Prevent_cross?= =?US-ASCII?Q?-cache_attacks_in_the_SLUB_allocator?= User-Agent: K-9 Mail for Android In-Reply-To: <782b131a-c3b9-7679-824a-70625c966def@intel.com> References: <20230915105933.495735-1-matteorizzo@google.com> <7a4f5128-28fd-3c5f-34c2-1c34f4448174@intel.com> <1d7573c0-ebbc-6ed2-f152-1045eb0542f9@os.amperecomputing.com> <782b131a-c3b9-7679-824a-70625c966def@intel.com> Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Tue, 19 Sep 2023 10:56:41 -0700 (PDT) On September 19, 2023 9:02:07 AM PDT, Dave Hansen wrote: >On 9/19/23 08:48, Matteo Rizzo wrote: >>> I think the whole "make it one single compile-time option" model is >>> completely and fundamentally broken=2E >> Wouldn't making this toggleable at boot time or runtime make performanc= e >> even worse? > >Maybe=2E > >But you can tolerate even more of a performance impact from a feature if >the people that don't care can actually disable it=2E > >There are also plenty of ways to minimize the overhead of switching it >on and off at runtime=2E Static branches are your best friend here=2E Let's start with a boot time on/off toggle (no per-slab, no switch on out-= of-space, etc)=2E That should be sufficient for initial ease of use for tes= ting, etc=2E But yes, using static_branch will nicely DTRT here=2E --=20 Kees Cook