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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 28225C001E0 for ; Tue, 8 Aug 2023 21:27:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=FqjxfoSACUI0kmlQNo4jcN5jJUbv3da7lbUZguzBXWQ=; b=cMqy3uF+fQm9zm GioPqdU+cY5LSzlX5vcZR4ofuXCslB/AG8VQezfZVnxvao25RVFpZ9l5csBE/I3O6nEpu+d+OsTfY JnuJAUVb+7GoSrO21HxH62pPjGAT8CTahK3yaKbGZKa+pLHtBiAGmpG++Lf7r3M6AZ7awvAtewTrG 7Ij1OjUEJjah5XpdcuAvbfGWqIxalcmQQNZgDkDdl0EQKQFD2mbyQ8HGcJHSX0o2K96lZxVdRA/lu P1XIjoY6M6PzvglEc1IPa7FpPGODG3lVQkXw+ToTEQ6/9iPxJt95GSQzQekpFg1qDobHthwHFx1Rq HHFM9TzLMWeJBCGO13DQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qTUEb-003VVG-2K; Tue, 08 Aug 2023 21:27:21 +0000 Received: from mail-pg1-x52e.google.com ([2607:f8b0:4864:20::52e]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qTUEY-003VUE-0w for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2023 21:27:19 +0000 Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-563e860df0fso4535399a12.2 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=A9VngGqXnkO8fDtvlBc5vxAm1gt5rEI/Kvx6Wvc/gPcGwVlTPFIiR6LdPWDRgEhqG1 natUyNwJTYbzbKvk90+dAl6QinZnBRDdFVQl2wSDMkJOflzVehSJqNGQQ3iA2T+fchnm yZkULFa+zkdVN4bVnF4JobUfaI+6mwg1ZPf7zyrctIXsSy9jYnuzgOyXwBgPJ0v1JKC5 dePkmSEZQr0qK0xeFdqry46z58RzYh01MZ/NN+9PrDHO9LpnxBoXi/sdiu7T8LLjIg/l fl86m2lTMMtEOCVm1zXm+dx3w54dM0yIEl/B9ykwc+QpME1Xh7Cgrp9UZ68ThSjcgixO 1fIA== X-Gm-Message-State: AOJu0YxNbg6McBMawinPShd5SzjKiUtkLHn8Vj8XP+QvFEvB0qhza7rH HrdQ10k80kD+2ZMyyT+sQBGCYA== 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> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230808102049.465864-3-elver@google.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230808_142718_346283_EA20EA41 X-CRM114-Status: GOOD ( 13.96 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org 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 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel