Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp9896755rwd; Wed, 21 Jun 2023 13:22:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7gylBxvygJF9WsPQ54P4ySanEMr2TZw5G73pAaczzo54YKgYgkq+yBNedgEWIy2um19LLS X-Received: by 2002:a17:903:2347:b0:1b6:a37a:65b7 with SMTP id c7-20020a170903234700b001b6a37a65b7mr2669071plh.23.1687378921424; Wed, 21 Jun 2023 13:22:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687378921; cv=none; d=google.com; s=arc-20160816; b=SAsfdjRb/GZ0+aq0GtgdBDT79sLntC8nX5XY1nAZFeiv+Dh0Ma4xMTM0jDRSVm04w9 UJNuKI9vdOkI96pKsyT5aGE3PcUOsjEACyjVsPbLY0F9i2xjeNtKa3pIhyoNHjkryxs4 Gxqs1AU2/bsf29f8etxZQoE35ChA5A/CuwakD/z3V0ci759dzYXPlkXumoKGz3r3MnQj 3SIFlf1Gs59ltjalshkq6HA33b2Q3BOtgQQTasmd/ALJr/9CtGFh7APGn5TRR6dFg5a6 6Zchfsp6hebiLQkNro9Wk6gJFxmEsAsXHaJjP1tcRjJcK+HN6Uk+hyGoyvbOfq1eEdJm dX1A== 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=bl/vfwqbfa4EkrcFk06848cTvtMeelbaz/CFyvtmcVQ=; b=gY9O67Tz/0Pv7TayxgA5EBa/kYqBqgOoyRmKlqiiwp3oPjqtORNxpdH11rYnMzMYb/ uNV7t4nxtBrbyAZLNZGedqITAXXPAkT7KNIsgDHp1KHwwGYMfK2G+aVorcZtu6SZ+PTx SGwb2LYrNtQojggtxQLLwGFSBxfk8sKp/34ERodcwHJhD+OKd2pyf+ljKFBEpTF9hP/w kuPuYR/aZMg7yNumqmt+gIUk7yXaRaeRqgIC5lL8163BnKrbn/FQ6KZnFReM0xouJJbF W5/8jTpptFVj5aCYOwvjr1w+tfv5y1sKIo6gOXKs5w+2vQlSO3QE/9sYY6B2QRvCs3DP 9GMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=PhGul3uy; 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 n3-20020a6546c3000000b005573a9229f0si1269292pgr.841.2023.06.21.13.21.48; Wed, 21 Jun 2023 13:22:01 -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=PhGul3uy; 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 S229814AbjFUUOK (ORCPT + 99 others); Wed, 21 Jun 2023 16:14:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47792 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229472AbjFUUOJ (ORCPT ); Wed, 21 Jun 2023 16:14:09 -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 25E1D199A for ; Wed, 21 Jun 2023 13:14:08 -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=bl/vfwqbfa4EkrcFk06848cTvtMeelbaz/CFyvtmcVQ=; b=PhGul3uy3Y61iKyp7AyoDlBctI 3s+T0SSP06sK/1hM2HTo2nCEaTRCTc+xDJlFWKi2en3Prw0iPUbYaPK1G2ZWiwIsiNs4fVyw0eEss C/fnhTYuCOmPcpe9Gu1pVW68bDbNdSi68uIN0qWhXnyjvAH86O3EBFwuPDYYujLIp20haDaaZ1KkR K65tl6QILqCaDxnEXwPDg7+nbt4Iv7BQkvpQ/xibGZQiAPXIJrzno2rVlVEs1AkEZXQje1RtifOjD yIF56IUsRWb7/lYTjxXsfi+NsS8qWYcYzmLaT0SsgATHFnQWfQREDBFTORKmYZhon8SHSgExl1hO+ PkBYYxjg==; 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.96 #2 (Red Hat Linux)) id 1qC4DF-0005DH-2J; Wed, 21 Jun 2023 20:13:58 +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)) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 4EBDF300222; Wed, 21 Jun 2023 22:13:57 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 2EE02213E05DC; Wed, 21 Jun 2023 22:13:57 +0200 (CEST) Date: Wed, 21 Jun 2023 22:13:57 +0200 From: Peter Zijlstra To: Kees Cook Cc: x86@kernel.org, alyssa.milburn@linux.intel.com, linux-kernel@vger.kernel.org, samitolvanen@google.com, jpoimboe@kernel.org, joao@overdrivepizza.com, tim.c.chen@linux.intel.com Subject: Re: [PATCH 1/2] x86/cfi: Fix ret_from_fork indirect calls Message-ID: <20230621201357.GQ38236@hirez.programming.kicks-ass.net> References: <20230615193546.949657149@infradead.org> <20230615193722.127844423@infradead.org> <202306201455.AF16F617A@keescook> <20230621085217.GI2046280@hirez.programming.kicks-ass.net> <20230621092759.GJ2046280@hirez.programming.kicks-ass.net> <202306211107.4D529222C@keescook> <20230621181659.GB4253@hirez.programming.kicks-ass.net> <20230621183356.GP38236@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230621183356.GP38236@hirez.programming.kicks-ass.net> 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,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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 Wed, Jun 21, 2023 at 08:33:56PM +0200, Peter Zijlstra wrote: > On Wed, Jun 21, 2023 at 08:16:59PM +0200, Peter Zijlstra wrote: > > On Wed, Jun 21, 2023 at 11:08:46AM -0700, Kees Cook wrote: > > > > > Ah yeah, it should be direct-called only. I keep forgetting about the > > > endbr removal pass. > > > > > > > I can't seem to manage to have it clobber it's __cfi hash value. Ideally > > > > we'd have an attribute to force the thing to 0 or something. > > > > > > Doesn't objtool have logic to figure out this is only ever > > > direct-called? > > > > It does; let me also use that same thing to clobber the kCFI hashes for > > these functions. > > Completely untested... gotta go put the kids to bed. I'll try later. With a few minor edits it seems to actually boot too. I'll go write up a Changelog tomorrow. Now I've got to discover how Drizzt's adventure continues ;-)