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 79E91C4345F for ; Wed, 1 May 2024 19:27:56 +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=gw/A+VDls8xQ/kZ4B1E/KsjES8JJ2Nm+INL3WejqN5E=; b=0dav8xSpRfhktu EN4Efbs8OGXHe6KcW57yqGksQaQyILYlF1KsRc4XIKRV89Mi3tiKJLirS3hEN4x2j6E0WJwwp3XrC jXaJEwP/fgXFIOoQwAGMzbFVV7VdJLS74pT6CUwiSbbXlOsu9V5kgugSaeMX5n2jouEVxBTkdr/4k 5Ct3MezoVDNY6goaOOQ9TDPp/Qzvhc10GjXEoEz6+5yt4B8QeOOXtyW5MZ1pVAe3d1LclWWkaVe+H Z5hrrn6Zm6gUDykqYwl9QjCIXhcIb/hpb3AaWpUdnYROJVsidLneP95VVAvCZIcQuC/mQ0nOOhjPP m9qapPmEMKAx5IjkfKdw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2FcH-0000000AVxw-1TBd; Wed, 01 May 2024 19:27:45 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s2FcE-0000000AVx2-0SHJ for linux-arm-kernel@lists.infradead.org; Wed, 01 May 2024 19:27:43 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1e3f17c6491so59001145ad.2 for ; Wed, 01 May 2024 12:27:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714591659; x=1715196459; darn=lists.infradead.org; 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=9+gDh6NM77cGHfdw7r6TvXLTNq5DARX9/1cTJfxUhiI=; b=E0wmZ+DqNnQdggyvv2MUvcdqooQ8v6W+dCDyz8VPhcm0aNbQbkkWpGuBFOUlv9zu+G FJTpO5MLnyxUvOp6LJrZ7kzaiJ325iYupN9UQrgI4d4mnLg+rKNl1E2Pld56cdWsmx6Y l2gWtxC1GJkLCFXlDAXg/xRS2RFsnB86V+Fs0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714591659; x=1715196459; 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=9+gDh6NM77cGHfdw7r6TvXLTNq5DARX9/1cTJfxUhiI=; b=bMfsGFoiM+VJ6VkLCf464ScOsEYljHgSFrk42tw2QmfC4otsmdr5gC0z5liyzLdqN2 ESQxYgu8rmO/ZIs/l1dYVV+POv+pr/2wlV6P24Lzgp1e16KO+olTKuRFLWdapeKKq+Xv cTeYf2dIGkZRGb+ArA71aavxMK4sSX07cFVq86ByOQwYLxMcHJuNMFB9dA9ndsfoEeyO KxtbDbMy/Q0y52M4Zy7hp34k7UTrY/xXMf82lTR34l/CNcBiTs5Reis8pKgEjX/llOQ4 1nqj8EUFaxb1ohG+Z71IYPfrs8Hs4cNFxrdy5tHxMrgbGg2uFfWjQUCBGy6b7/fY2Q+N TOjQ== X-Forwarded-Encrypted: i=1; AJvYcCU4C6PMtbS3dXQyBLkJtXunOzY7y96ECiwfkQcv6zUT4QwvqRyhxZ3/IS/w0V7gA9cOl+4KZNy2Frl9Cr8F7MG3Xxsc8G+ZboH9jXqoz19xrm5ZHEc= X-Gm-Message-State: AOJu0YxtjhZ8SEZv3WX9nttMhern4FgtN5jEwFycwrwHY8fN7QLm6VXU Pm/vtKCD/Yyh+kFuD6+Ihz51iILCaDNqdBOUddSzWybjOUsf3hkQxu2eWZwPvg== X-Google-Smtp-Source: AGHT+IFOqiuy3jqUmROs8uWUXbDQ4LpVCOGiqzH5ePrGMAGevXpVZpwp5HMlWqxDJM6lzgjTQUJGyw== X-Received: by 2002:a17:902:c212:b0:1eb:76ac:b4e5 with SMTP id 18-20020a170902c21200b001eb76acb4e5mr3312554pll.49.1714591659325; Wed, 01 May 2024 12:27:39 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id d14-20020a170903230e00b001eb17af8493sm10043502plh.184.2024.05.01.12.27.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 12:27:38 -0700 (PDT) Date: Wed, 1 May 2024 12:27:38 -0700 From: Kees Cook To: Peter Zijlstra Cc: "Gustavo A. R. Silva" , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Nathan Chancellor , Nick Desaulniers , Bill Wendling , Justin Stitt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH] hardening: Refresh KCFI options, add some more Message-ID: <202405011217.B822CA08@keescook> References: <20240426222940.work.884-kees@kernel.org> <20240430092140.GE40213@noisy.programming.kicks-ass.net> <202404301037.9E34D4811@keescook> <20240501110614.GI40213@noisy.programming.kicks-ass.net> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20240501110614.GI40213@noisy.programming.kicks-ass.net> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240501_122742_175041_95B7CD3C X-CRM114-Status: GOOD ( 20.70 ) 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 Wed, May 01, 2024 at 01:06:14PM +0200, Peter Zijlstra wrote: > On Tue, Apr 30, 2024 at 10:48:36AM -0700, Kees Cook wrote: > > On Tue, Apr 30, 2024 at 11:21:40AM +0200, Peter Zijlstra wrote: > > > On Fri, Apr 26, 2024 at 03:29:44PM -0700, Kees Cook wrote: > > > > > > > - CONFIG_CFI_CLANG=y for x86 and arm64. (And disable FINEIBT since > > > > it isn't as secure as straight KCFI.) > > > > > > Oi ? > > > > Same objection I always had[1]: moving the check into the destination > > means attacks with control over executable memory contents can just omit > > the check. > > I thought it was game over if you could write arbitrary test anyway? Yes, an attack having arbitrary write control over an executable memory area is the place where CFI does get much weaker. But presently, there's no reason to make it easier. With the hash randomization we have, an attack needs to locate and read the kcfi_seed, otherwise everything else is a fixed value. In the future, when we have viable X^R kernel text, then the trade-off becomes much more clear: we want FineIBT very very much. :) > The whole CFI thing was about clobbering data (function pointers to be > more specific), and both are robust against that. Yes, if the threat model is limited to arbitrary writes to function pointers, we're totally good with FineIBT. -Kees -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel