From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.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 805241836C7 for ; Tue, 30 Apr 2024 21:15:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714511756; cv=none; b=EbO2/zrUfeDThP9ZaKSoOBDiozCVqWkYIwWWfyt+B5ZyfNZE9fyWmRHOacsAXRt+y+JJWwT9sRSpM6sOwPk7b83vgRCIfMCKi4REF8ZC3yiuJ9X1fFYC8W8HY49A9jIZJaXUvSULEhugQ0wTM1CJv2Mp6KeAdG73QR5c+su7YyU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714511756; c=relaxed/simple; bh=XQKlbJsQcaAkcPsjQz8sjCihNDTs2E45cJWg1QLYlE0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=vFioCtf+Y+eTY7YMeQkeJ+DBv7XysqKkEHfAUz7hQYcswAw+2267OcWSgkkCUoo1jdDl4iXjQxzWpLTDym53RsEjzZtgNYDHVecYj3t8oPOWMDzT9SBCiboHDGJNJf9BW4gisQ02B19X7DjvuKcGPsChVryZeV42i7XVG38UL+8= 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=VrOgMPln; arc=none smtp.client-ip=209.85.214.182 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VrOgMPln" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1eab16c8d83so50256315ad.3 for ; Tue, 30 Apr 2024 14:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1714511755; x=1715116555; darn=lists.linux.dev; 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=ybsFpX0X7CRfB780REANsMjNyYm7Y9wsUjgmwPZjU6k=; b=VrOgMPlnV6hnKOLqc7R4ya4hv3trgL3XQ5SDJmTsGMsvu6sJ/FEtUmzU/xSfNULA0p 5ukwZId7aJW8LQjZ/VEJCHA4gkWeqc1VzqiTgkdHKmHYe3W22t/4R9kZnNAeAI0KzVu2 93YpclXQhzyKO9NFsJFUJaxeMqCN1z5fjKiu4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714511755; x=1715116555; 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=ybsFpX0X7CRfB780REANsMjNyYm7Y9wsUjgmwPZjU6k=; b=D6iQr9/1t7ncbWBO34eotE1JtFeh3xlOr/vKCHmCGtTD5gK/+utk8Hpuy5tdUpwyhE 3sbKYvihSsTGuv6cnKSSFPsPmsPu+VPyiRUoU0xGexHI0+G+u7cKjDSZTk+5b/k5TJ2H rj8rlF8e/BlU+d7NA/yh/hv7Qhmcim79MzCvmNajLZPicCMms4hNq187YZYfu2xgw7ie cg49k1sCGMsZ0WgdTPv1MxUa1rsALGAhfe7USEDwD8RpcD1+BvdfQHKPlnpVIMpGDXmT pLvFUjBU7NQcuyb+uUSwerZkxN8SOYM7atEsr3b3A1f4HSiwM/IzD2GxaGBx/HBLmRro AGCA== X-Forwarded-Encrypted: i=1; AJvYcCUgGqwUV3JMltaHuHq4yAjzruO4npMsY/J1sfUCwPa9gbvSWPlZpbQAMjoANN4BeYITpgJ/JOvEluwdDOIa0PYeBJ/A9Q== X-Gm-Message-State: AOJu0YwJM+IVeweccEVjJi7fgV6O8W+oWnXFcqNVi6sbKwIX15ITRwIE W7816k4AUPYM+F1AV1B59UU7ImcEusA/HO8Rx4j3B9Xk55nOQaLEnrM7GYL40w== X-Google-Smtp-Source: AGHT+IH65fhAB52q5SRM6fEv53OUPrvdI7HGuP4UMAsLKQOmSK4SnZFW69AZXJZQZh3NFJXh2vI83Q== X-Received: by 2002:a17:902:82c9:b0:1ea:42d1:1421 with SMTP id u9-20020a17090282c900b001ea42d11421mr548705plz.68.1714511754804; Tue, 30 Apr 2024 14:15:54 -0700 (PDT) Received: from www.outflux.net ([198.0.35.241]) by smtp.gmail.com with ESMTPSA id w19-20020a1709027b9300b001e435fa2521sm22879566pll.249.2024.04.30.14.15.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Apr 2024 14:15:54 -0700 (PDT) Date: Tue, 30 Apr 2024 14:15:53 -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: <202404301409.D3BC98D5@keescook> References: <20240426222940.work.884-kees@kernel.org> <20240430092140.GE40213@noisy.programming.kicks-ass.net> <202404301037.9E34D4811@keescook> 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: <202404301037.9E34D4811@keescook> 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* -- Kees Cook