Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3746669pxb; Wed, 13 Oct 2021 12:05:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypMQYmACoRrMPpRi7RXEaIY7T8M6eQUb1A/zEPq+I63ZS/S/DwLeBk+J5E4ZNRc8Td3Ajz X-Received: by 2002:a17:90a:fb4a:: with SMTP id iq10mr1122253pjb.117.1634151939520; Wed, 13 Oct 2021 12:05:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634151939; cv=none; d=google.com; s=arc-20160816; b=DSXu0jqJk2nHHWycRl7pra1h0nSpp3vCCyvzM/nmS1ANpgeqZEPnwtGfnom1Ci5fTA pLCxhSWap1ZMTFMxn+r4XvJNlKJca6CcSHEQ54GGB/bO0pbcqwSp3FBxspv2yv6lJWWX FyJ5SZEYjfpXeodn4oi+p0ViPakbNX1RsUySO2tosFD4vLFV8wySFiqgctqSdxnfSS/T 2Q8kTvoR7U7Fh9CAHn64zbHEZ8Vj4vNuBtXfA7dOteNBVndPvZbzeRkVne4DZ3S75pey 5zK1stgUU447TArzPmvT/B4E3WYG+SU5c6D5eKcWePgmsU6HJaGTMIVxL0y7q2w+eOVJ Bugg== 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=aGF0syKET/14pAZ283IwwssrcdQD4oceHIsj+/z6tks=; b=e1lcb1hdZesamcRPbc+6TiW/bKSa1JS1Ir3pTsW3OH3pdDndwlyzrUhF8xrhW5djHQ 8Yh5qZ/zSANMZGLs/SIIJZa5BASrNXf+i08IEi6JO0oDxtq8B2Y0OQY+fyq5YVyayHtO r2o6SJMdksFf6iXGm0Qw63IrTKV4Upojkp7lWlLvIT0oP6pGy9vUhq5dcj2Uk/sL0wu2 KgdZetHIqa4z2GmHv9oCcvpSoyb/GVCV9VRJh04HQF76VfFHrYGcKr5XgaP9a1rymLU2 mXPgcHmzIlJQzTnOuKsnJbcDh6uGzpBKWNjd7oqi1QBbO3C7D2C134qQvx0G7Q3zWwg9 ZQKw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=LnqQnYl3; 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 d2si596878plg.186.2021.10.13.12.05.22; Wed, 13 Oct 2021 12:05:39 -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=LnqQnYl3; 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 S231263AbhJMTGN (ORCPT + 99 others); Wed, 13 Oct 2021 15:06:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230313AbhJMTGM (ORCPT ); Wed, 13 Oct 2021 15:06:12 -0400 Received: from mail-pl1-x62e.google.com (mail-pl1-x62e.google.com [IPv6:2607:f8b0:4864:20::62e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 226E2C061570 for ; Wed, 13 Oct 2021 12:04:09 -0700 (PDT) Received: by mail-pl1-x62e.google.com with SMTP id g5so2495037plg.1 for ; Wed, 13 Oct 2021 12:04:09 -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=aGF0syKET/14pAZ283IwwssrcdQD4oceHIsj+/z6tks=; b=LnqQnYl3SGc8N9da5oJ7HSa9JQluc0g0UMXaBb59l0VvGm3rZTsDEJ3cWkzZmxjid/ YJNnC+reIBHb27GLFgvmXO/GujmCskpdflq1rRdb/vMqb8PA26FHlXzR+mnQSz8fnRGI UrA48mlhSXLYQxTJEcuJCIvV3bQ4XLqFKLR54= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=aGF0syKET/14pAZ283IwwssrcdQD4oceHIsj+/z6tks=; b=B8Oc7yCx0ji3oXJomd9oaQCr1GeUJrcHgLpiuMKuelfdTMJTpTF7QZxwQp5hdP0PMG H1HzjE9UopTCkDcQos9ogMIyt15WKopC0ZEdkcIO0xBriiTo+pJzTTs6gIW1LrB9N2i8 MAKhG4AIh41/1hYClRCHUKf+RHgmyuuj+6GgLdPE6uzTCEh2SBqTxf/pgP+0GMSjaEOh 5UnoVIm+RSWS+iVaorGA5dPDegQofD2KYloZ0FEoZ9lBxJNYmrVuLDleL/hckSBDZ7Gi GS6ebQt7v/JeoLMk5WQsc6yknHO33AOpRDoujsBa6vhNnMVcmI2oU/hPsprk85VoE9v8 xUgw== X-Gm-Message-State: AOAM531NuwN2/Ywty9Og0EquswX8yBan/90e5uU2vb8ZWzLV+aDGRUoz /+Mb8/d2RRkDWHJXYKpnX4r0OQ== X-Received: by 2002:a17:90b:4d0b:: with SMTP id mw11mr1137541pjb.135.1634151848679; Wed, 13 Oct 2021 12:04:08 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id l4sm248494pga.71.2021.10.13.12.04.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Oct 2021 12:04:08 -0700 (PDT) Date: Wed, 13 Oct 2021 12:04:00 -0700 From: Kees Cook To: Sami Tolvanen Cc: x86@kernel.org, Josh Poimboeuf , Peter Zijlstra , Nathan Chancellor , Nick Desaulniers , Sedat Dilek , Steven Rostedt , linux-hardening@vger.kernel.org, linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH v5 06/15] ftrace: Use an opaque type for functions not callable from C Message-ID: <202110131203.2BA230B8@keescook> References: <20211013181658.1020262-1-samitolvanen@google.com> <20211013181658.1020262-7-samitolvanen@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20211013181658.1020262-7-samitolvanen@google.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 13, 2021 at 11:16:49AM -0700, Sami Tolvanen wrote: > With CONFIG_CFI_CLANG, the compiler changes function references to > point to the CFI jump table. As ftrace_call, ftrace_regs_call, and > mcount_call are not called by C code, but are trampolines injected > as calls replacing the nops at the start of functions added by the > compiler, use DECLARE_NOT_CALLED_FROM_C to declare them. > > Signed-off-by: Sami Tolvanen Looks right to me... Reviewed-by: Kees Cook -- Kees Cook