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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F31EC433EF for ; Mon, 16 May 2022 16:25:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343583AbiEPQZa (ORCPT ); Mon, 16 May 2022 12:25:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41460 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1343573AbiEPQZ2 (ORCPT ); Mon, 16 May 2022 12:25:28 -0400 Received: from mail-yw1-x1134.google.com (mail-yw1-x1134.google.com [IPv6:2607:f8b0:4864:20::1134]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 84A1B39163 for ; Mon, 16 May 2022 09:25:27 -0700 (PDT) Received: by mail-yw1-x1134.google.com with SMTP id 00721157ae682-2fb9a85a124so156020347b3.13 for ; Mon, 16 May 2022 09:25:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=RFls9zXfp5eTyiIQ+m2636iSt9xdwj1AtOgJeBph0LY=; b=YhXgB7NNVPD0yB1cDQg/SXVjUhX8SLXmuhEnMy8wBpqtJx2W1ubPNizgIU8zF85A9O 4NabimscaxUtttPG7Gr13TcfobOte2BzOayOW/nlwMPCItIILzLtfLGgrw0uPqLvr1vN XhCPSDdmLiEtsD6yxSIRy5iwnZW/KIs5ZQCvm+r8msHjrgEmUHxjk2lQ6TIaPDXKbnYz sZhpeFcc2mDSmxSZpJ7TQKJHp4vjLedto83hHVkTNkoOpl6hYpxqNRN2G2PQWhl4aJCW EgK5oKNTRRk7HwbzJy09mdNldhGb4JoY04hsQgAJjG7sZFNeQ1kpT4ixGA+HzY9SOCsG 1lBQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=RFls9zXfp5eTyiIQ+m2636iSt9xdwj1AtOgJeBph0LY=; b=NNyg8FCSbjassiQ+NOrAqNZQzDWlV5T+ujGuTvQXGqr+4kz2pUhWyUU3ieerXxnZoh nbBus7+Y7zyGf4ceCtXEfOtsiADphg1h0zcbw6rvTrVb/Wgp5NhGIeN//PBjjbJzEjIW dJ5MNZPtdZugvYGHRUek+ZItNPYTXD7OOf31lW5YY2lW0qgM34bn0P2EpS0WWHmAW4VA YT28ZvPhE4icCRUHswp4xC67qUBQdpH1HHc1K7m27th/3CPJRA9o57O/dNYmZ7gxWx5O 4KzrqccWM1g2l+J40wiH5R2hU/+E+JBgMTiXSyZWjEMA5gt0cozA+atJhWqUxIp8aKKS OqYQ== X-Gm-Message-State: AOAM533aje+K+S17gTDIran/QacPEpg1cp3Ojzw0QZofcbcsf4h7i9t/ NZA5NntRgwecWIiaVgjkExN0Rwo6oYWJalPb4oIypg== X-Google-Smtp-Source: ABdhPJze0FlbTm24mJB4UEHbsfYPEzROSnDu0xvZSbQCYGCBpmmty4Y0jTVl7jr510LqdmFqqvrpYIOVuhdO38wQmIQ= X-Received: by 2002:a81:4ecf:0:b0:2fe:d9f2:15b3 with SMTP id c198-20020a814ecf000000b002fed9f215b3mr10961808ywb.305.1652718326620; Mon, 16 May 2022 09:25:26 -0700 (PDT) MIME-Version: 1.0 References: <20220513202159.1550547-1-samitolvanen@google.com> <20220513202159.1550547-11-samitolvanen@google.com> <202205141451.AABEE8B@keescook> In-Reply-To: <202205141451.AABEE8B@keescook> From: Sami Tolvanen Date: Mon, 16 May 2022 09:24:50 -0700 Message-ID: Subject: Re: [RFC PATCH v2 10/21] arm64: Add CFI error handling To: Kees Cook Cc: linux-kernel@vger.kernel.org, Josh Poimboeuf , Peter Zijlstra , x86@kernel.org, Catalin Marinas , Will Deacon , Mark Rutland , Nathan Chancellor , Nick Desaulniers , Joao Moreira , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-arm-kernel@lists.infradead.org, llvm@lists.linux.dev Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, May 14, 2022 at 2:51 PM Kees Cook wrote: > > On Fri, May 13, 2022 at 01:21:48PM -0700, Sami Tolvanen wrote: > > With -fsanitize=kcfi, CFI always traps. Add arm64 support for handling > > CFI failures. The registers containing the target address and the > > expected type are encoded in the first ten bits of the ESR as follows: > > > > - 0-4: n, where the register Xn contains the target address > > - 5-9: m, where the register Wm contains the type hash > > > > Suggested-by: Mark Rutland > > Signed-off-by: Sami Tolvanen > > It might be nice just to include an example exception Oops in this > commit log. Agreed, I'll add an example. Sami