Re: [PATCH] kasan: include <linux/instruction_pointer.h> for _RET_IP_

From: Alexander Potapenko

Date: Wed Jul 01 2026 - 04:00:05 EST


On Wed, Jul 1, 2026 at 9:06 AM Tao Cui <cui.tao@xxxxxxxxx> wrote:
>
> From: Tao Cui <cuitao@xxxxxxxxxx>
>
> kasan.h uses _RET_IP_ but relied on <linux/trace_printk.h>, included via
> <linux/kernel.h>, to provide it. Commit 9cbc3d9806d3 ("tracing: Remove
> trace_printk.h from kernel.h") dropped that transitive include, so files
> that don't otherwise get instruction_pointer.h no longer build, e.g.
> kernel/scs.c on arm64 KASAN:
>
> include/linux/kasan.h:199:43: error: use of undeclared identifier '_RET_IP_'
>
> Include <linux/instruction_pointer.h> directly to make the dependency
> explicit.
>
> Fixes: 9cbc3d9806d3 ("tracing: Remove trace_printk.h from kernel.h")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202606301759.hTqHaPuI-lkp@xxxxxxxxx/
> Signed-off-by: Tao Cui <cuitao@xxxxxxxxxx>
Reviewed-by: Alexander Potapenko <glider@xxxxxxxxxx>