Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp883772pxb; Wed, 27 Oct 2021 14:25:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxZKMFj+xq77hCGD6pApbA4Fzw4yHioQSRVGeP/yVew1TfSkGt7RYaOr7zAWqw2Thd0S1b6 X-Received: by 2002:a05:6402:510c:: with SMTP id m12mr476353edd.33.1635369955213; Wed, 27 Oct 2021 14:25:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635369955; cv=none; d=google.com; s=arc-20160816; b=xQ975L2hSrMzWgOtt5Nix/QREXPyWipaFdakwL6Rgav1707UOA+mg7zByBL7ldJld2 /RjPRwqKsKMoSgi3zhKuKnSczPFVYPhu5YB+Np5pHVA2Ae45v3dfpVT4ZYr+CF/26BFk etQDUkvP5g+H9pf9t9D+iAaW7zxqpaH/LT4qHFwtvbqdyChGbEstMkyvOC4ZmqrjfpQi 0tMbM0i7l8llDttbdysjCyVWaLbnIoSoTlaInsV7+wn1H7ZQRbxFxEedXYCD+gSPLeQY dnQ2c06zUh/DhvYRIV+AqDng1h37dWXwPTiHXGb9WpXUSHDjMOHyC/EBY0chL5yufZeh UKDw== 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=Cgkvcdwq0dJTP6ir5a7HxudmZPEOWaKKsMrUIHRFI/o=; b=EHJmeuojG/Xw2nvEJIhT1wp9tINNiweEnEnzGv65c9BCNGx1MMddqiYiaB6nVBVnd1 AhsXu4HchBJDoE08aUBImLNbxiPU9qOyvdOeYmIPNISX/at3aaFJzuHE7NTaopD37E6Y WNfWVFnAS+suNlR/w/6NmFeghkGI1yDhdnnA6J13sXyv0m4VDG4PD3jwCfbc86LGKQ1P vlT5Q8/XfYU7yTxP3r2Q6ftTS+f8U1MoxVQAqdnJS/5z78HT7mU39UB46ztDJveDbKwV Tp7CGR0B3qIv795HsUTTVOeG4u+jiy9zxgpz97ADcPjT9Dbw76mAkaLo/ALmWjj5Bf/8 ydww== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=og3HchEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g5si1262607ejo.390.2021.10.27.14.25.31; Wed, 27 Oct 2021 14:25:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=og3HchEr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231166AbhJ0My0 (ORCPT + 97 others); Wed, 27 Oct 2021 08:54:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbhJ0MyZ (ORCPT ); Wed, 27 Oct 2021 08:54:25 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B25A5C061570; Wed, 27 Oct 2021 05:51:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=Cgkvcdwq0dJTP6ir5a7HxudmZPEOWaKKsMrUIHRFI/o=; b=og3HchErpvnTFHKZlelb9+dlvq 8ru+KFjDxKagLEYcb5toOiS1A84QArMCc7LwLJOekz0CPZm1sIlbDt5AiMedG9k8OjqwxnikmOW0a vpDBzYunxz51QUU+4Jzzh3St53MewLvV6rsqC2o4D8B7w0bjHWKeJa3nafRLrdub8lhEn5Qf2rSUE ac133ljKr5WuUTzLLt0X7sQSPcUY0wewP+o6ZgIntI3Pgm72i84DOrr2LVwcWAq68ddvMutW1dvYH SJDA6flr6cV7yl3J+EBS0sHE6O89v9tNOXGgnqUqsqTpQpmvLUlz1kOVQIWnLduvDOMKDpLW8E63A s+PKQECg==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1mfiMQ-0003D7-0b; Wed, 27 Oct 2021 12:49:28 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 566C598629C; Wed, 27 Oct 2021 14:48:52 +0200 (CEST) Date: Wed, 27 Oct 2021 14:48:52 +0200 From: Peter Zijlstra To: Ard Biesheuvel Cc: Mark Rutland , Sami Tolvanen , X86 ML , Kees Cook , Josh Poimboeuf , Nathan Chancellor , Nick Desaulniers , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, Linux Kernel Mailing List , llvm@lists.linux.dev Subject: Re: [PATCH v5 00/15] x86: Add support for Clang CFI Message-ID: <20211027124852.GK174703@worktop.programming.kicks-ass.net> References: <20211013181658.1020262-1-samitolvanen@google.com> <20211026201622.GG174703@worktop.programming.kicks-ass.net> <20211027120515.GC54628@C02TD0UTHF1T.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 27, 2021 at 02:22:27PM +0200, Ard Biesheuvel wrote: > On Wed, 27 Oct 2021 at 14:05, Mark Rutland wrote: > > > Should not this jump-table thingy get converted to an actual function > > > address somewhere around arch_static_call_transform() ? This also seems > > > relevant for arm64 (which already has CLANG_CFI supported) given: > > > > > > https://lkml.kernel.org/r/20211025122102.46089-3-frederic@kernel.org > > > > Ugh, yeah, we'll need to do the function_nocfi() dance somewhere... > > > > Sadly, that only works on symbol names, so we cannot use it to strip > CFI-ness from void *func arguments passed into the static call API, > unfortunately. Right, and while mostly static_call_update() is used, whcih is a macro and could possibly be used to wrap this, we very much rely on __static_call_update() also working without that wrapper and then we're up a creek without no paddles.