public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Mark Rutland <mark.rutland@arm.com>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [mark:randomize-kstack-siphash 1/1] arch/x86/include/asm/entry-common.h:95:2: error: call to undeclared function 'choose_random_kstack_offset'; ISO C99 and later do not support implicit function declarations
Date: Wed, 26 Nov 2025 04:37:53 +0100	[thread overview]
Message-ID: <202511260422.Q4byvNJU-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mark/linux.git randomize-kstack-siphash
head:   0783912db6e30339d55a5dc7eb6a696b440bedb3
commit: 0783912db6e30339d55a5dc7eb6a696b440bedb3 [1/1] HACK: use siphash to generate kstack offset per-task
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251126/202511260422.Q4byvNJU-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251126/202511260422.Q4byvNJU-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202511260422.Q4byvNJU-lkp@intel.com/

All errors (new ones prefixed by >>):

   In file included from arch/x86/entry/syscall_64.c:8:
   In file included from include/linux/entry-common.h:5:
   In file included from include/linux/irq-entry-common.h:12:
>> arch/x86/include/asm/entry-common.h:95:2: error: call to undeclared function 'choose_random_kstack_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      95 |         choose_random_kstack_offset(rdtsc());
         |         ^
>> arch/x86/entry/syscall_64.c:89:2: error: call to undeclared function 'add_random_kstack_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      89 |         add_random_kstack_offset();
         |         ^
   2 errors generated.
--
   In file included from arch/x86/entry/entry_fred.c:12:
   In file included from arch/x86/include/asm/idtentry.h:11:
   In file included from include/linux/entry-common.h:5:
   In file included from include/linux/irq-entry-common.h:12:
>> arch/x86/include/asm/entry-common.h:95:2: error: call to undeclared function 'choose_random_kstack_offset'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
      95 |         choose_random_kstack_offset(rdtsc());
         |         ^
   1 error generated.


vim +/choose_random_kstack_offset +95 arch/x86/include/asm/entry-common.h

fe950f6020338c Kees Cook       2021-04-01   84  
fe950f6020338c Kees Cook       2021-04-01   85  	/*
6db1208bf95b4c Kees Cook       2024-06-19   86  	 * This value will get limited by KSTACK_OFFSET_MAX(), which is 10
6db1208bf95b4c Kees Cook       2024-06-19   87  	 * bits. The actual entropy will be further reduced by the compiler
6db1208bf95b4c Kees Cook       2024-06-19   88  	 * when applying stack alignment constraints (see cc_stack_align4/8 in
fe950f6020338c Kees Cook       2021-04-01   89  	 * arch/x86/Makefile), which will remove the 3 (x86_64) or 2 (ia32)
fe950f6020338c Kees Cook       2021-04-01   90  	 * low bits from any entropy chosen here.
fe950f6020338c Kees Cook       2021-04-01   91  	 *
6db1208bf95b4c Kees Cook       2024-06-19   92  	 * Therefore, final stack offset entropy will be 7 (x86_64) or
6db1208bf95b4c Kees Cook       2024-06-19   93  	 * 8 (ia32) bits.
fe950f6020338c Kees Cook       2021-04-01   94  	 */
6db1208bf95b4c Kees Cook       2024-06-19  @95  	choose_random_kstack_offset(rdtsc());
2f8f173413f1cb Pawan Gupta     2025-08-14   96  
2f8f173413f1cb Pawan Gupta     2025-08-14   97  	/* Avoid unnecessary reads of 'x86_ibpb_exit_to_user' */
2f8f173413f1cb Pawan Gupta     2025-08-14   98  	if (cpu_feature_enabled(X86_FEATURE_IBPB_EXIT_TO_USER) &&
2f8f173413f1cb Pawan Gupta     2025-08-14   99  	    this_cpu_read(x86_ibpb_exit_to_user)) {
2f8f173413f1cb Pawan Gupta     2025-08-14  100  		indirect_branch_prediction_barrier();
2f8f173413f1cb Pawan Gupta     2025-08-14  101  		this_cpu_write(x86_ibpb_exit_to_user, false);
2f8f173413f1cb Pawan Gupta     2025-08-14  102  	}
167fd210ec0555 Thomas Gleixner 2020-07-23  103  }
167fd210ec0555 Thomas Gleixner 2020-07-23  104  #define arch_exit_to_user_mode_prepare arch_exit_to_user_mode_prepare
167fd210ec0555 Thomas Gleixner 2020-07-23  105  

:::::: The code at line 95 was first introduced by commit
:::::: 6db1208bf95b4c091897b597c415e11edeab2e2d randomize_kstack: Remove non-functional per-arch entropy filtering

:::::: TO: Kees Cook <kees@kernel.org>
:::::: CC: Kees Cook <kees@kernel.org>

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2025-11-26  3:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202511260422.Q4byvNJU-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=llvm@lists.linux.dev \
    --cc=mark.rutland@arm.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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