Received: by 2002:ab2:60d1:0:b0:1f7:5705:b850 with SMTP id i17csp709718lqm; Wed, 1 May 2024 13:13:31 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXIbkdeD+p0NwNOMWOv72pGJZLVeAKx0gAirYsYuAvGvc74RxSfeCPM1rVnLpfUfjC33/s5EElZ1POP2jDru1U08vqft/MWxqs5TyCigg== X-Google-Smtp-Source: AGHT+IHBlpBo2eF53tZdupldaBIOIjVvicfZxciuUvUK9sLUbvBWaIdykq185Sh+4aXSJQUZ5AWK X-Received: by 2002:a05:6214:d6d:b0:6a0:cb7c:68c7 with SMTP id 13-20020a0562140d6d00b006a0cb7c68c7mr3806601qvs.65.1714594411617; Wed, 01 May 2024 13:13:31 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714594411; cv=pass; d=google.com; s=arc-20160816; b=be2WVgObUv6O62is7xQr8c4vupK9j5OY1G6NxKSM2Nk3/PrXPjy8lKRzE5ueKGrMPt k36ZsatQcSuZSi+snM8TPLaZMQQasjXX5T8ZSa0DcLiXqNyMWCxWu8kgGAn06Ceyl93Y zzP8seLxyUHd++bgb4CcVe7HkwBj22JI8SILFv+6h25DFoocrQTCZWMiX0Lk3K7QajCa qyLISqfvJlt6oGhqiY5ODE8UpaISOpKLcRaleHSfCXFt7sQs2czm0jr/thaagjANZw1N 2pIxCc+nSM8vj6rLQC8HRjSZUX4h+oc1Jj8FNnOqaCK4yYr1jvQV3ENOlY5OwKrHelCu Kv8A== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=fzJNyUjTcyvayOGi2RmNTOhiNWDsJ2lrCXlytRPvm1U=; fh=FBjNrR096ikYgiCzJjsnUWNQ5ZBuKHy9/tmR9lWCOko=; b=VyPCXuKSkcygYpSnTFe4ZI+wCZBXNlhTo0xJNbzW5SxyYPLUF8oVGLH8eCdMAeWeJr 0wVc357TYt0Qkg4M+5YL+5OIRIPtkR86mnnDO9g0Nw7qukW8oA0pR2HTCmvYkqOy4Dli 79hp3rZW8/kIQWSJveo7oZSIfH0JesaLAeH2ioPnCF+3O2my1X301qEFVhdvWVUFL5Iq mr1TZoAcQagYcsQyvAYEof/Rn0JWCPRvQAc+Ii9xDDzwBOb98h+bbHHam3Qh8IjpAckQ INQhGW9Jp/EjInPY9rkEBSjFNrVR2WShmJz54nFD5fcvXIllmCzOo3v0Ppd2d+0++GWL 6jRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cq73uVVR; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-165739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h12-20020ac8584c000000b0043ab15d54afsi10701308qth.703.2024.05.01.13.13.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 13:13:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-165739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=Cq73uVVR; arc=pass (i=1 spf=pass spfdomain=chromium.org dkim=pass dkdomain=chromium.org dmarc=pass fromdomain=chromium.org); spf=pass (google.com: domain of linux-kernel+bounces-165739-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-165739-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 581071C22CA5 for ; Wed, 1 May 2024 20:13:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id ACDA11635A9; Wed, 1 May 2024 20:13:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="Cq73uVVR" Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) (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 7E00A42A96 for ; Wed, 1 May 2024 20:13:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.172 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714594405; cv=none; b=sEEnWJyP2SeZz0ZaLI+JA0gvgHuGx54sHJ/hu0wyfDVf6N+ZLsNOd9CqoK8WVJGZCcPA/Pw0cD4NI79pLZ5HvofgB4aSK7cqHqBYf4veEHhqPTlBwvMn8F7ataGVi7L9LteAy9ylHFolvCrJFPF9hGk2vFL2cfEl5oKtl8yU9n0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714594405; c=relaxed/simple; bh=4ywZCAUhnkyRouoGXFeP3qU1/bxbRV5WojnoTHw3CAw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=taccVhV5DRUXybrynSmPsDNTcWrrVzQkMQqZCY4BN2vFNJpbstZvAwZDrgdGqw0P7feOirPJtO6UuSjROVD0s52k90gdtxKGvPNXP8krnDmyNjO3qCHpi3bme9JGEJbAs9ic+BycNb/JYejaLzAIhd4VOx9rLd6izcGxn1AScIQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=Cq73uVVR; arc=none smtp.client-ip=209.85.210.172 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-6eced6fd98aso6362601b3a.0 for ; Wed, 01 May 2024 13:13:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714594404; x=1715199204; darn=vger.kernel.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=fzJNyUjTcyvayOGi2RmNTOhiNWDsJ2lrCXlytRPvm1U=; b=Cq73uVVRzj6HMzdt5QVbKcr/k76sr9w0oytb6P2zs1XmFrJQL2WJAjDEvo/OXwfGcU oQj2RnQNNI+6TylFn99Ju9q37kCwj4K2lsl9p50RDz3Lqf+8GXrsFpwXoC8oYlXs1VeS vNiJII/xVcT2nJRFmSyWzO4p1i1CxQHIjlQqk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714594404; x=1715199204; 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=fzJNyUjTcyvayOGi2RmNTOhiNWDsJ2lrCXlytRPvm1U=; b=n5ehXP1FYt4Gyv2/RBkhKa68eH5r6Y9+6bAL5/Px+jxzoQO/ky8Dg+Ka1ijzp/h9S9 d5VVRNfqqollD6JadsccTXmeyihO5BIQv3Cdf3sRAHoCUW0v50W68EOr5lenMjStv2Qq VkC/X3QSucDHKfHP/vGC4KQBD2/wAwt0cvKm2WPTs8fEf4bV2DaqwuWeOWbfNpJ86TLY hFxsx73r8zIgZUypJgm+zcYf6hYhj4eQOy6YILxifEssJBHXdJ3T922jQ0Z6Qmm6PORy VF76XK3gXNGAzwigtzbtYiyX9h8aS5PaimssrC5DU+q+X4mzEyeJc5SIYd+AVmBZlvUN YxQQ== X-Forwarded-Encrypted: i=1; AJvYcCWs5+2cOt2Sr1anFMGDyBG/U0nAeWIcvth//VvTp8HQGa5z06uTAlLH132CreYx5oob0awxyqnJkJOsgv3T0kugn7xjf2bp/NcU1Na5 X-Gm-Message-State: AOJu0YwpFATx2DGm+oIhfnAJFWYtI8HL8GdcByDBXV+VmvPLhVKzkAwE yOVH097zPe3nC/w0qLCDXI/OLFRNVJryhJ8oGWBhdTBdWY1gUkQnjGaehEsOTg== X-Received: by 2002:a05:6a21:1a8:b0:1a7:5fbf:3774 with SMTP id le40-20020a056a2101a800b001a75fbf3774mr5708830pzb.55.1714594403848; Wed, 01 May 2024 13:13:23 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id d2-20020aa78142000000b006ed007b3596sm23070981pfn.69.2024.05.01.13.13.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 May 2024 13:13:23 -0700 (PDT) Date: Wed, 1 May 2024 13:13:22 -0700 From: Kees Cook To: Nathan Chancellor Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , x86@kernel.org, "H. Peter Anvin" , Alexei Starovoitov , Sami Tolvanen , Josh Poimboeuf , Juergen Gross , Breno Leitao , linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org Subject: Re: [PATCH] x86/alternatives: Make FineIBT mode Kconfig selectable Message-ID: <202405011307.2C8E9BE5E@keescook> References: <20240501000218.work.998-kees@kernel.org> <20240501163314.GA2472577@dev-arch.thelio-3990X> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240501163314.GA2472577@dev-arch.thelio-3990X> On Wed, May 01, 2024 at 09:33:14AM -0700, Nathan Chancellor wrote: > On Tue, Apr 30, 2024 at 05:02:22PM -0700, Kees Cook wrote: > > Since FineIBT performs checking at the destination, it is weaker against > > attacks that can construct arbitrary executable memory contents. As such, > > some system builders want to run with FineIBT disabled by default. Allow > > the "cfi=kcfi" boot param mode to be selectable through Kconfig via the > > newly introduced CONFIG_CFI_AUTO_DEFAULT. > > > > Signed-off-by: Kees Cook > > I verified that flipping the configuration does indeed change the > default and that 'cfi=' could still be used to override whatever choice > was made at compile time. This patch was a perfect excuse to put my new > CET enabled test machine to work. Heh, yeah. I have my one lonely CET system that is only powered on for this sort of testing too. ;) > > Reviewed-by: Nathan Chancellor > Tested-by: Nathan Chancellor Thanks! > CFI_DEFAULT_AUTO reads a little bit better to me personally but I am not > looking to get into painting today :) I went with CFI_AUTO_DEFAULT since this seems to be our current pattern for setting these kinds of boot param defaults. A selection of examples: arch/Kconfig:config RANDOMIZE_KSTACK_OFFSET_DEFAULT lib/Kconfig.debug:config CONSOLE_LOGLEVEL_DEFAULT mm/Kconfig.debug:config DEBUG_PAGEALLOC_ENABLE_DEFAULT -- Kees Cook