From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f182.google.com (mail-pg1-f182.google.com [209.85.215.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CB1E3E569 for ; Tue, 8 Aug 2023 21:27:16 +0000 (UTC) Received: by mail-pg1-f182.google.com with SMTP id 41be03b00d2f7-564ca521549so3189556a12.1 for ; Tue, 08 Aug 2023 14:27:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1691530036; x=1692134836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=WblHbZVi4y1TIh0is8Z580iO5wWlNJUK6HXQ9JjhgNs=; b=F+HSs+30LbbD7LWLs51xR5SiEqJ2oiCvmPzqlD3Ecv9DEOHs/wkXgZzJH4ClAnNBzX zenuP2vXfauJP3r5oF6gRTD3Q1p5qIerdcrr7AeT8hG18l1QB/MSo+zaYoMIyS6xhuHQ 2fMzPOsY+5Qj2bv9jfiCk13I61StyikOrIRJ4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691530036; x=1692134836; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=WblHbZVi4y1TIh0is8Z580iO5wWlNJUK6HXQ9JjhgNs=; b=kS+U5QrB6yF4CJNwepaI4dH3hbbAssIZlVYLaC9WRtZxpbLVxmhNTCmBTz3pav57Wj C8xhxWZ6kioJ/8mcfPsr/2p7wMRk8EsbiCoO1DIPp8NisVHIwcwwSTZAq4f7WIk+9cTE 5onvUkFFXT7GnJvcs9jhqcyjbYuDEBtUrTGdWM+XyKnZR4Hxj9FSWvF/JRS7zPhNy18d +qT9PH7jp0WUNJMJZqg1NvVtdDiUGbiD0+QkNYqancdP3rkbyiSGb7kTGmq96opwwTSk nHch85sKJUReQDaAR/ZCmd4u7ke4uXoLEyPPuQ2y1d/C6uZBIhxTQFjmMdns0szvR17O QDJA== X-Gm-Message-State: AOJu0YwXerx2uNNTkXERHksXjYgsF8CTPbazXQ03Y+wLn4Ki3n366Tpx xG0X40MVE/K7B8AdAzj3RHLjHQ== X-Google-Smtp-Source: AGHT+IEpwJM6Jc4WcMb3mJvAt6p7/C2NHQNV/HRelcc6S222LnIkMpF4YqE3P9H/uvT6fxfUl39uZQ== X-Received: by 2002:a17:90b:358b:b0:25b:c8b7:9e5b with SMTP id mm11-20020a17090b358b00b0025bc8b79e5bmr680387pjb.31.1691530036117; Tue, 08 Aug 2023 14:27:16 -0700 (PDT) Received: from www.outflux.net (198-0-35-241-static.hfc.comcastbusiness.net. [198.0.35.241]) by smtp.gmail.com with ESMTPSA id p4-20020a17090b010400b00267f1455d60sm1328pjz.20.2023.08.08.14.27.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Aug 2023 14:27:15 -0700 (PDT) Date: Tue, 8 Aug 2023 14:27:14 -0700 From: Kees Cook To: Marco Elver Cc: Andrew Morton , Guenter Roeck , Peter Zijlstra , Mark Rutland , Steven Rostedt , Marc Zyngier , Oliver Upton , James Morse , Suzuki K Poulose , Zenghui Yu , Catalin Marinas , Will Deacon , Nathan Chancellor , Nick Desaulniers , Tom Rix , Miguel Ojeda , Sami Tolvanen , linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev, linux-kernel@vger.kernel.org, llvm@lists.linux.dev, Dmitry Vyukov , Alexander Potapenko , kasan-dev@googlegroups.com, linux-toolchains@vger.kernel.org Subject: Re: [PATCH v3 3/3] list_debug: Introduce CONFIG_DEBUG_LIST_MINIMAL Message-ID: <202308081424.1DC7AA4AE3@keescook> References: <20230808102049.465864-1-elver@google.com> <20230808102049.465864-3-elver@google.com> Precedence: bulk X-Mailing-List: llvm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230808102049.465864-3-elver@google.com> On Tue, Aug 08, 2023 at 12:17:27PM +0200, Marco Elver wrote: > Numerous production kernel configs (see [1, 2]) are choosing to enable > CONFIG_DEBUG_LIST, which is also being recommended by KSPP for hardened > configs [3]. The feature has never been designed with performance in > mind, yet common list manipulation is happening across hot paths all > over the kernel. > > Introduce CONFIG_DEBUG_LIST_MINIMAL, which performs list pointer > checking inline, and only upon list corruption delegates to the > reporting slow path. I'd really like to get away from calling this "DEBUG", since it's used more for hardening (CONFIG_LIST_HARDENED?). Will Deacon spent some time making this better a while back, but the series never landed. Do you have a bit of time to look through it? https://github.com/KSPP/linux/issues/10 https://lore.kernel.org/lkml/20200324153643.15527-1-will@kernel.org/ -Kees -- Kees Cook