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 EEE79C4345F for ; Tue, 30 Apr 2024 21:25:59 +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=UWlo2gg62zDTc8EwWWsEGqE28oUed8nhpfl/JP4jeYI=; b=AMmBcrypK6w5Ho +bEi0a5HIbGlOTfULjBgOlaTtXvCyFIZOafFcNCD+QxB8GkpEzd7EIN0E1T4Bmr1SV9ecfeGWnzBL SUIzIrnlRsqFhd4ORLmHo2pqc8PZ6tZe/gT3M2jaACxj2Euu/BybqVCgYFQKS6vVDCgfEc06iC1+m aT2SJC+hNgXGGkfs8ksJkIxJxER4xWW02W/GQt9/gAhZ8mVSLStQbGll0tx2iXcBlsa/OFyz8ER7B 5CVTiJ5h6e9ypYjU8kkBBEt0yKPeCcB1z7kE1Xi/eRMF0lxosOysDxCHB8R/xq1j4iISGawWznvcR V3VGij2jlydrBEfoHdEQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1uyw-00000007xo6-1Qxy; Tue, 30 Apr 2024 21:25:46 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1s1uys-00000007xm8-46PM for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2024 21:25:45 +0000 Received: by mail-pg1-x529.google.com with SMTP id 41be03b00d2f7-5f80aa2d4a3so5101399a12.0 for ; Tue, 30 Apr 2024 14:25:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714512336; x=1715117136; 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=yL344saeiEHbqmyOopyOdGQH0USlm3SnC2xCq0SoJLU=; b=Q1btPAWukG0vD5dQTxoUs7pm8gJTfIVWLJYsVeQL7il8UlZp0v9WycASou2xBuNcxJ 16LHVrmyoGA1ox93Hul+O/0yoTzHDHdvHA+SjOMUA6BMJ01YO/XaDh1H1QWBSfxZHGlr gzunNZ6lFSewJ2lrmSXcirPFmovg32jAqCIm8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714512336; x=1715117136; 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=yL344saeiEHbqmyOopyOdGQH0USlm3SnC2xCq0SoJLU=; b=vE6k/yiV5s6y5zO+8CATiCWKAADYqQZOAZ5zK3rQhO+g06QNe2yrdlbWArzqVu+3EQ Fs1TUKowCJG/ka/qxpescsoNpeqf/Uu9adcKtjleSWLoYWBhRb3s3XZOUK7W5WVt9MR+ mwfmyaXhD4l0h4IALi6MkSWqfwXaVH2NgqpuSgGvaO7ZsEDuc8XXYOxa9gn59E1EE4Uf B3neQ3jcnfSFBNSQrHhWWL9Lo1sa+sejLIo05fdTJCuXNk6d0eVmma1iqW4MTSQv2pAq /Ml2dLusIlXPO5qvT5l42ZMFjsNa+gHmEnoV5M4bvLzzt8KYMWX4j5GHTBvAlD1bShJS WnVg== X-Forwarded-Encrypted: i=1; AJvYcCUUoDrrKSBU2iAn1EauPDCy0pthjnT4AdynyxOeBJ46ImDAoRp5SYS9oZx8aUZkGkb808Sg5kN648SMjQFFzZ2u49glejkqfvwcVK649LBvwSCsMTQ= X-Gm-Message-State: AOJu0YwoMNVjrjqQnk1rKQCPFEcS0bXL6xAC9Qh0UkGUMjd1wQUdjnOp PEa+3m3v5dci6jT6HSPVS/xibIkyZBLIqZt/SWh1If6oenJJMG8F42afj7n9Lg== X-Google-Smtp-Source: AGHT+IFIxVelglvKW5StU7tXy2dZZm6BsDNmXrzU8ELIShBXYB5SRyvBVWCFfa0CxoN7Rk5noHrHnA== X-Received: by 2002:a05:6a21:998:b0:1af:4fd7:6c6f with SMTP id li24-20020a056a21099800b001af4fd76c6fmr545627pzb.35.1714512335948; Tue, 30 Apr 2024 14:25:35 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id fb33-20020a056a002da100b006ed14fed3a5sm21507308pfb.154.2024.04.30.14.25.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 14:25:35 -0700 (PDT) Date: Tue, 30 Apr 2024 14:25:34 -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: <202404301424.FF88864115@keescook> References: <20240426222940.work.884-kees@kernel.org> <20240430092140.GE40213@noisy.programming.kicks-ass.net> <202404301037.9E34D4811@keescook> <202404301409.D3BC98D5@keescook> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <202404301409.D3BC98D5@keescook> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240430_142543_031160_88836DAA X-CRM114-Status: GOOD ( 21.61 ) 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, Apr 30, 2024 at 02:15:53PM -0700, Kees Cook 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. > > > > But now that I went to go look I see 0c3e806ec0f9 ("x86/cfi: Add boot > > time hash randomization") is only enabled under FINEIBT... seems better > > if that were always enabled... > > And FINEIBT actually can't be disabled... :| > > And as it turns out CFI_CLANG doesn't work at all on v6.9... > > [ 0.587220] no CFI hash found at: __call_sites+0x339a8/0x34450 ffffffffac20cef8 00 00 00 00 00 > [ 0.588226] WARNING: CPU: 0 PID: 0 at arch/x86/kernel/alternative.c:1182 __apply_fineibt+0x7a9/0x820 > ... > [ 0.619220] SMP alternatives: Something went horribly wrong trying to rewrite the CFI implementation. > *hang* Welcome to my TED talk. I'll keep debugging this: boots fine on v6.8, but booting v6.9 with defconfig+CFI_CLANG _does_ work, so something in my .config broke it... -- Kees Cook _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel