Building the Linux kernel with Clang and LLVM
 help / color / mirror / Atom feed
From: Masami Hiramatsu (Google) <mhiramat@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Sami Cclvanen <samitolvanen@google.com>,
	Kees Cook <kees@kernel.org>,
	Eva Kurchatova <eva.kurchatova@virtuozzo.com>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	llvm@lists.linux.dev, linux-kernel@vger.kernel.org,
	stable@vger.kernel.org
Subject: Re: [PATCH] cfi: Include uaccess.h for get_kernel_nofault()
Date: Sat, 6 Jun 2026 11:17:12 +0900	[thread overview]
Message-ID: <20260606111712.c004ecfb4a590a20b4ccb909@kernel.org> (raw)
In-Reply-To: <20260604-tracing-fix-cfi-h-build-error-v1-1-b27015390901@kernel.org>

On Thu, 04 Jun 2026 17:33:21 -0700
Nathan Chancellor <nathan@kernel.org> wrote:

> After commit 0652a3daa787 ("tracing: Fix CFI violation in probestub
> being called by tprobes"), there are many build errors when building
> ARCH=arm multi_v7_defconfig + CONFIG_CFI=y like:
> 
>   In file included from drivers/base/devres.c:17:
>   In file included from drivers/base/trace.h:16:
>   In file included from include/linux/tracepoint.h:23:
>   include/linux/cfi.h:44:6: error: call to undeclared function 'get_kernel_nofault'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
>      44 |         if (get_kernel_nofault(hash, func - cfi_get_offset()))
>         |             ^
>   1 error generated.
> 
> get_kernel_nofault() is called in the generic version of
> cfi_get_func_hash() but nothing ensures uaccess.h is always included for
> a proper expansion and prototype. Include uaccess.h in cfi.h to clear up
> the errors.
> 
> Cc: stable@vger.kernel.org
> Fixes: 0652a3daa787 ("tracing: Fix CFI violation in probestub being called by tprobes")
> Signed-off-by: Nathan Chancellor <nathan@kernel.org>

Oops, good catch!

Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>

Thank you!

> ---
>  include/linux/cfi.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/linux/cfi.h b/include/linux/cfi.h
> index 1fd22ea6eba4..0f220d29225c 100644
> --- a/include/linux/cfi.h
> +++ b/include/linux/cfi.h
> @@ -9,6 +9,7 @@
>  
>  #include <linux/bug.h>
>  #include <linux/module.h>
> +#include <linux/uaccess.h>
>  #include <asm/cfi.h>
>  
>  #ifdef CONFIG_CFI
> 
> ---
> base-commit: 0652a3daa78723f955b1ebeb621665ce72bec53e
> change-id: 20260604-tracing-fix-cfi-h-build-error-36c2becf7d15
> 
> Best regards,
> --  
> Cheers,
> Nathan
> 


-- 
Masami Hiramatsu (Google) <mhiramat@kernel.org>

      parent reply	other threads:[~2026-06-06  2:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-05  0:33 [PATCH] cfi: Include uaccess.h for get_kernel_nofault() Nathan Chancellor
2026-06-05 15:16 ` Sami Tolvanen
2026-06-06  2:17 ` Masami Hiramatsu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260606111712.c004ecfb4a590a20b4ccb909@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=eva.kurchatova@virtuozzo.com \
    --cc=kees@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=nathan@kernel.org \
    --cc=rostedt@goodmis.org \
    --cc=samitolvanen@google.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox