Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp902482pxf; Thu, 8 Apr 2021 16:01:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyzAI3VLSjbg6YfHB9Eo4Xwei1MT4L1UE95M2VKzkunQLyCgZtekyNctAo9Wuv/lAQOOuLm X-Received: by 2002:aa7:8f3d:0:b029:246:d5f6:9f91 with SMTP id y29-20020aa78f3d0000b0290246d5f69f91mr238391pfr.55.1617922869506; Thu, 08 Apr 2021 16:01:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617922869; cv=none; d=google.com; s=arc-20160816; b=SK0p1IkR9DurmvEsbHbXgVe80R/BaKczVl4O9j0H7e7in8KrO0G9JqVZNltTN0WMdm wQB1SZdBCdfGlY8rOlCVNOPWb+8+t+nHVtzQUBrnZ8CUyUXDKcf0CFi1u1SwEUSScZ4M QKGSHgYNV9QAvxoCV6uiQZXKx2h7L2KLFibl26aw22cp9gN7ABKSQSNl/MjfGkrpuFBi UGOyjKwU8AatLeMLcvhiVHR/VEmLSvGm6xwQOmX5O3Q47alYBdtTMyX+jvEtWUkD4ZV5 olbj38VelRGDTeO68lQS2QN7gtADcs1uf25MthBSxv5fGJnwJwBgu90szIk4++MOw6cF +A3Q== 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=60tuWIbUjG0iyC8nYrQdXxsGuNpmQhEiUDZqyLR6c1Y=; b=Ktb/ZiRETpI3cZOdMcFGmEPmAtYElW1E2Pwnzag9tBrv5smnBWiyVSIJTErHYmkEMT s6W+NAV4/ez6/pSi3yGYCInXbA2m8cxmHpc5Q23m35T5tOADlC/f1/n+9bm2/bPYU9S2 0kNpagQGXqtL7XcGLucmGHzR8IShovbIxGWBzfcjaeUagSJdqVCfLybIGa7gB34RmwRm xF+NSL0yIvAegJL+2XwNQdvPq0yqQ4us6tBPzGpsw8m6PK65FBai6OVFT0upOPM4g32i CclDSySf/9v+m0tW2RqydclCFnOBOhoxOxWJBnMntH5NLWdvmC4SR6ICXAbJ7p+CMmWZ KULA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=mTnrJmw6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 73si784179pgf.398.2021.04.08.16.00.56; Thu, 08 Apr 2021 16:01:09 -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=@chromium.org header.s=google header.b=mTnrJmw6; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232937AbhDHXAI (ORCPT + 99 others); Thu, 8 Apr 2021 19:00:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51122 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232903AbhDHXAG (ORCPT ); Thu, 8 Apr 2021 19:00:06 -0400 Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33B49C061763 for ; Thu, 8 Apr 2021 15:59:55 -0700 (PDT) Received: by mail-pl1-x62f.google.com with SMTP id j7so1803512plx.2 for ; Thu, 08 Apr 2021 15:59:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=60tuWIbUjG0iyC8nYrQdXxsGuNpmQhEiUDZqyLR6c1Y=; b=mTnrJmw6Pc4S3mQP2I8SdRxPl0N5UkqJYhxgb56iNBXgYefgG11RdYQzPa/MB/dvPV jbLIhoH9o0hDGMLI5J3taqG+MEIgRNkMDDkUxbyMT5US7eZygaGqQIpeNB+TgGrghMRI gHQzdPXo0gJXu2PRuODNsA4Gmr8eePdCipd+c= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=60tuWIbUjG0iyC8nYrQdXxsGuNpmQhEiUDZqyLR6c1Y=; b=SJtYuS/cGhFIk1oLzgzay2J/Oc475vqIZo5399HSDQb965uja8Fh3eHIyTYrgFb2DX 8P2PGMv05lx+ASq7LE4my2dglEfjTJCx9lQMyVSVCfRUxYD5eDrbfwSRWSaVz953A2TY ZY1ZQ27O3BlLCqE61mT7f6cWeZgqEO4t3lz1FppXIOqjDeZ4xyTBM0mZdG9aJMHhMgrs KG4Q6oNJ8pItPtXHFAYALtvzTz3pbdY85zJ1VTs+kxIgoPcDQHN7POyqIa3F9SYM3/1G qGBmEflz/yim7qr85ib7f2ti3m151/yeL+HuEtyXBO7Ye5n8wG5MKNobUbdl1EVZgC1Q Zg/w== X-Gm-Message-State: AOAM530n2TyoCgp5uk7ps5BR2+cNBjvFFOY+KTpREL0StCDIOjVgVEyy IP7cZYG2/NcLtC7/NYdkEbIJ9Q== X-Received: by 2002:a17:902:7c83:b029:e8:c368:543 with SMTP id y3-20020a1709027c83b02900e8c3680543mr9895464pll.58.1617922794624; Thu, 08 Apr 2021 15:59:54 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id q95sm368117pjq.20.2021.04.08.15.59.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 08 Apr 2021 15:59:54 -0700 (PDT) Date: Thu, 8 Apr 2021 15:59:53 -0700 From: Kees Cook To: Sami Tolvanen Cc: Nathan Chancellor , Nick Desaulniers , Masahiro Yamada , Will Deacon , Jessica Yu , Arnd Bergmann , Tejun Heo , "Paul E. McKenney" , Christoph Hellwig , Peter Zijlstra , Sedat Dilek , Mark Rutland , Catalin Marinas , bpf@vger.kernel.org, linux-hardening@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kbuild@vger.kernel.org, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com Subject: Re: [PATCH v6 00/18] Add support for Clang CFI Message-ID: <202104081558.9A5FE3A@keescook> References: <20210408182843.1754385-1-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210408182843.1754385-1-samitolvanen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 11:28:25AM -0700, Sami Tolvanen wrote: > This series adds support for Clang's Control-Flow Integrity (CFI) > checking. With CFI, the compiler injects a runtime check before each > indirect function call to ensure the target is a valid function with > the correct static type. This restricts possible call targets and > makes it more difficult for an attacker to exploit bugs that allow the > modification of stored function pointers. For more details, see: > > https://clang.llvm.org/docs/ControlFlowIntegrity.html > > The first patch contains build system changes and error handling, > and implements support for cross-module indirect call checking. The > remaining patches address issues caused by the compiler > instrumentation. These include fixing known type mismatches, as well > as issues with address space confusion and cross-module function > address equality. > > These patches add support only for arm64, but I'll post patches also > for x86_64 after we address the remaining issues there, including > objtool support. > > You can also pull this series from > > https://github.com/samitolvanen/linux.git cfi-v6 This is working quite well for me and it looks like there are good reviews. I'm going to toss it in linux-next unless anyone has objections. I'm very excited to start using this. :) -Kees -- Kees Cook