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 08251C4332F for ; Tue, 20 Dec 2022 00:10:24 +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=2C+hSuyn9mYu/X3E16pOw68chuQwCqrwH/Emb2SMT2M=; b=JP0BEwXW6+Pgat CwRg1xxWDnUjXsmGulUmGiup+p29zF0yN5a4tAq+A0u6wVMSE8MY0d1G7CpANS0+nIA34g7A3Pa7J 9tYHTUkz78sbwOhNCsMZq7Gfrp3bW649bCcmgXAvcvZ/dqjm3Oua7TDx7BvzwcnMuMZFxaamTJEWz Iu0I9976KOp+RPCy9TTJUy6AK7+GDHh545vQJIJzpjIy9sdvVLhdixHxFkNYTzN9NWpPmVOz360wu Js+0L0vk8W57T1oP9ke1pVeLofTJRzGUsEmMDECtxlg46DZRuaplcfRESCWqYd27yR8zOMFwJLTJC oebIXnInqZr/voIKiu8w==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7QBs-005Pls-I3; Tue, 20 Dec 2022 00:09:04 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1p7Pia-00575H-KX for linux-arm-kernel@lists.infradead.org; Mon, 19 Dec 2022 23:38:50 +0000 Received: by mail-pl1-x636.google.com with SMTP id 17so10629989pll.0 for ; Mon, 19 Dec 2022 15:38:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=user-agent: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=iXhT24A08qIcxdPTrS8ABQk+wBAUtPj45USUD+WsbiA=; b=ikqXE5Sv3C0Z7QeUtZToua8qSUDYVrSpl1Z9eJm2snZpS6OYsJc66Mfj20vV+0kPqu dJhRFfhQtTYN1idfPqN83/0d5vmM5VLsImAkcxhWamazE/Rzr8GOW4qft50gVwJ4Hhme 9FnDCgoMYp+l81g3xM7zvGN5i5vgKDqndedskEpd/sQeT2H2JIeNd14Z3ce5m6XtXvot t6C0qffyNuSAAtBnkYOAXx8MwJ/Del1fMjSU8HT5jS04SBiPtD2lzNOJZJliwGOsDDBk VC10uCA4xKtmWCbS/HtqbWj3Q2c/3GeZueSi6nzS4zUf2jKbbiY97HjsaePUMSCqfFFm lxvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=user-agent: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=iXhT24A08qIcxdPTrS8ABQk+wBAUtPj45USUD+WsbiA=; b=XqLRdNae8XhbJegTzIYBWML1Pa6LtukkVcbo3liyK0R5uX+fFkmpaZ+PWgIqCHbSAk zTXqgClxFoHXktjj/MJ10hVXLMvV+XYClILEeizFGFgF1Mced95cEOfvSPqHxAUE70pl 6/V8IjyWqld5QsCoJgYK6ZWsWhGOIESxJT0lhz6wmknCRLcVr+G/h2sD5JaxnZe+I5i8 Aqx68GFVwEFGbifWgDmWiu44fvhlunyjeWs7En7oLwz9LS7VnP19O4HXpFdzHYRAhv+g 8xMfnOoi6jOUK0qKD9OyEXt6VEO2aXK7xU07tSe62nQWL1/I2CyXQyELWtHttIFMT8V/ CzaQ== X-Gm-Message-State: ANoB5pl7NZa8TKmZM43pvEimkr6gvBzhmPkNNpet2/OEnOcMCuXVzxUf +nOXGWLaLzvbyTNWatDEMyQ= X-Google-Smtp-Source: AA0mqf55hr5HQ4Ig2SkTPhbHUQlrDlMKeYo/BxR2QRmG3IvAb7Xasm3E+qJ9b5UhrNWehUFuiwNBQA== X-Received: by 2002:a05:6a20:9c8f:b0:a2:17a6:3e86 with SMTP id mj15-20020a056a209c8f00b000a217a63e86mr32379941pzb.55.1671493126783; Mon, 19 Dec 2022 15:38:46 -0800 (PST) Received: from localhost ([124.248.219.206]) by smtp.gmail.com with ESMTPSA id w6-20020a170902e88600b0017f8094a52asm7790420plg.29.2022.12.19.15.38.46 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 19 Dec 2022 15:38:46 -0800 (PST) Date: Mon, 19 Dec 2022 15:38:41 -0800 From: Dan Li To: Peter Zijlstra Cc: Masahiro Yamada , Michal Marek , Nick Desaulniers , Catalin Marinas , Will Deacon , Sami Tolvanen , Kees Cook , Nathan Chancellor , Tom Rix , "Paul E. McKenney" , Mark Rutland , Josh Poimboeuf , Frederic Weisbecker , "Eric W. Biederman" , Marco Elver , Christophe Leroy , Song Liu , Andrew Morton , Uros Bizjak , Kumar Kartikeya Dwivedi , Juergen Gross , Luis Chamberlain , Borislav Petkov , Masami Hiramatsu , Dmitry Torokhov , Aaron Tomlin , Kalesh Singh , Yuntao Wang , Changbin Du , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Subject: Re: [RFC/RFT] CFI: Add support for gcc CFI in aarch64 Message-ID: <20221219233841.4ywyegnzqhzfr4fo@ubuntu> References: <20221219061758.23321-1-ashimida.1990@gmail.com> <20221219132731.6ng4sz2nv6ujvu7i@ubuntu> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20171215 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221219_153848_762317_C3FE1459 X-CRM114-Status: GOOD ( 30.64 ) 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 12/19, Peter Zijlstra wrote: > On Mon, Dec 19, 2022 at 05:32:04AM -0800, Dan Li wrote: > > Hi Peter, > > > > On 12/19, Peter Zijlstra wrote: > > > On Sun, Dec 18, 2022 at 10:17:58PM -0800, Dan Li wrote: > > > > > > > 1. When a typeid mismatch is detected, the cfi_check_failed function > > > > will be called instead of the brk instruction. This function needs > > > > to be implemented by the compiler user. > > > > If there are user mode programs or other systems that want to use > > > > this feature, it may be more convenient to use a callback (so this > > > > compilation option is set to -fsanitize=cfi instead of kcfi). > > > > > > This is not going to be acceptible for x86_64. > > > > I'm not familiar enough with the x86_64 platform, could you please > > tell me why this is not acceptable? Is there a similar situation > > on the arm64 platform? > > Mostly because the call would be a 5 byte instruction while the trap > (UD2) is only 2 bytes. Oh ok, got it. > I suspect Argh64 has a similar problem if the to be called function is > outside the immediate range (26 bits or thereabout), in which case you > end up with a multi-instruction sequence to construct the call target or > so. A trap is always a single instruction. > Yes, IIRC, long jumps also typically require at least three instructions in arm64. Thanks, Dan. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel