Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp76065rwi; Tue, 18 Oct 2022 14:21:18 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4tM6IzjSaE06oRAsr5R7Q/vKiadc7+8ZcuphzifMf5vVRaPTjw3OQcOcEwGid8FPtDIMPw X-Received: by 2002:a17:906:5dcc:b0:78d:e76a:ef23 with SMTP id p12-20020a1709065dcc00b0078de76aef23mr3914714ejv.317.1666128078571; Tue, 18 Oct 2022 14:21:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666128078; cv=none; d=google.com; s=arc-20160816; b=JfXB3oiDOqOEkjQzPQNRky3/zpTCIPI9zjFekmTtaRZ6/se6JMvY0Y6VY9w4t2HebE vhjVb5AN/1VD5vwsTxgZCcbWUK2AcSjA0UIdSogtd8N5/UZv4TwMOxShYdoBYtlYVjOi lJZmkI8AVigZxD2/mTGFDMT7dyLQm+wGzsw5hTWG6w+AdHIAoVTnQAlqRTwPCuCpujAz PjwecW1DyQjjpcbbz9X1KOCJ7aELdpGpX1db22pCt8XHZk2n2ELY9NxQisNR3WJUsw8S S4O016xyMlypVYYPRmPSRkMkDIcl7Frocs6AVtKW6QZ9Eo9ouf8ULthzIED52Bu1re9c AIfQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=azLS4jtI34+AVvBn3oePJJ5T90tPMjIIZAeIJU4/1fw=; b=QUAXMRKgtw9X/PKtTPiO1ykvLt69m+3o0TVbErZuphhSa0TbdxUMbpbXgvD9QQH26P 401nXCX6I7yhbHlELdddeIF3OAqcmDunXiETv8yc4bCUYegzOf7Gno0yAC6BZVBH+OVO 3xTzo+4rhwrT8O6Hcxl7s4DqR31wNmoQOltttN8tTKnsVKnen0ifTmltyUkeSN2zpBCZ 7giyE+66fKOrjoLhUjGtKUbKAcoZ2LgkuwBWmStT5cwyz3pCDgzwlIzF5pa6JG5Si7Gm Fo/hYKUuGSLHtkDf1PLvwA4+tn5o2K7L/oxsSFA8UNmLTljWUDnu21IlnBWYmgx+boNp OpBg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OoUitWYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i4-20020a170906698400b00783d969f318si11418884ejr.253.2022.10.18.14.20.50; Tue, 18 Oct 2022 14:21:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=OoUitWYT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230187AbiJRVJl (ORCPT + 99 others); Tue, 18 Oct 2022 17:09:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58006 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230130AbiJRVJi (ORCPT ); Tue, 18 Oct 2022 17:09:38 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5C472606 for ; Tue, 18 Oct 2022 14:09:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=azLS4jtI34+AVvBn3oePJJ5T90tPMjIIZAeIJU4/1fw=; b=OoUitWYTA44ZCa0YmRW2sKqL66 /bZZLWHBrJ/kRt5R05b28quHN9DIQiPppO2tMZqyyY2BddLLlLjeGPDsAmyotQ/nyuCjuOZ9ju76Q dXgHczkMg2sH+N56KLiWqwt9P6cMaZTgp0WGhyrrDF7m9JZ9FCHJYy9UsZtaijsTFjtdqmCKWC9wv MBlpDMHgVmqkGmTE1DDwjywpNNgCu+v/eBkjWepvVHSxKz1E6zgihej/GzTYxUOKZgzTDBcLLmYtt AK2e6l3w4a4N1pn/aS8yvvmYl3AXEjqmWg1NMF8xUc7gjmffV2ltNmPMGJguHW9ePFdsSxKBXw2td IUJg8t9A==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oktq0-004ZyB-VU; Tue, 18 Oct 2022 21:09:25 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 27C313000DD; Tue, 18 Oct 2022 23:09:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 086432C0A0314; Tue, 18 Oct 2022 23:09:24 +0200 (CEST) Date: Tue, 18 Oct 2022 23:09:23 +0200 From: Peter Zijlstra To: Kees Cook Cc: x86@kernel.org, Sami Tolvanen , Joao Moreira , linux-kernel@vger.kernel.org, Mark Rutland , Josh Poimboeuf Subject: Re: [PATCH] x86/ibt: Implement FineIBT Message-ID: References: <202210181020.79AF7F7@keescook> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 18, 2022 at 09:59:02PM +0200, Peter Zijlstra wrote: > @@ -732,6 +734,8 @@ static __init int cfi_parse_cmdline(char > cfi_mode = CFI_KCFI; > } else if (!strcmp(str, "fineibt")) { > cfi_mode = CFI_FINEIBT; > + } else if (!strcmp(str, "norand")) { > + cfi_rand = false; > } else { > pr_err("Ignoring unknown cfi option (%s).", str); > } Plus so I suppose, otherwise it'll still randomize the hashes even if it then leaves the whole thing disabled, which seems a bit daft :-) Index: linux-2.6/arch/x86/kernel/alternative.c =================================================================== --- linux-2.6.orig/arch/x86/kernel/alternative.c +++ linux-2.6/arch/x86/kernel/alternative.c @@ -730,6 +730,7 @@ static __init int cfi_parse_cmdline(char cfi_mode = CFI_DEFAULT; } else if (!strcmp(str, "off")) { cfi_mode = CFI_OFF; + cfi_rand = false; } else if (!strcmp(str, "kcfi")) { cfi_mode = CFI_KCFI; } else if (!strcmp(str, "fineibt")) {