All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Deepak Gupta <debug@rivosinc.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: Re: [PATCH v21 25/28] riscv: create a config for shadow stack and landing pad instr support
Date: Tue, 21 Oct 2025 02:48:17 +0800	[thread overview]
Message-ID: <202510210232.L2yY8OFS-lkp@intel.com> (raw)
In-Reply-To: <20251015-v5_user_cfi_series-v21-25-6a07856e90e7@rivosinc.com>

Hi Deepak,

kernel test robot noticed the following build errors:

[auto build test ERROR on 3a8660878839faadb4f1a6dd72c3179c1df56787]

url:    https://github.com/intel-lab-lkp/linux/commits/Deepak-Gupta/mm-VM_SHADOW_STACK-definition-for-riscv/20251016-021733
base:   3a8660878839faadb4f1a6dd72c3179c1df56787
patch link:    https://lore.kernel.org/r/20251015-v5_user_cfi_series-v21-25-6a07856e90e7%40rivosinc.com
patch subject: [PATCH v21 25/28] riscv: create a config for shadow stack and landing pad instr support
config: riscv-randconfig-001-20251020 (https://download.01.org/0day-ci/archive/20251021/202510210232.L2yY8OFS-lkp@intel.com/config)
compiler: riscv64-linux-gcc (GCC) 13.4.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251021/202510210232.L2yY8OFS-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/202510210232.L2yY8OFS-lkp@intel.com/

All error/warnings (new ones prefixed by >>):

   arch/riscv/kernel/usercfi.c: In function 'amo_user_shstk':
>> arch/riscv/kernel/usercfi.c:136:9: error: implicit declaration of function '__enable_user_access' [-Werror=implicit-function-declaration]
     136 |         __enable_user_access();
         |         ^~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/usercfi.c:140:60: error: expected ':' before '_ASM_EXTABLE'
     140 |                 "1: ssamoswap.d %[swap], %[val], %[addr]\n"
         |                                                            ^
         |                                                            :
     141 |                 _ASM_EXTABLE(1b, %l[fault])
         |                 ~~~~~~~~~~~~                                
>> arch/riscv/kernel/usercfi.c:141:30: error: invalid suffix "b" on integer constant
     141 |                 _ASM_EXTABLE(1b, %l[fault])
         |                              ^~
>> arch/riscv/kernel/usercfi.c:148:9: error: implicit declaration of function '__disable_user_access' [-Werror=implicit-function-declaration]
     148 |         __disable_user_access();
         |         ^~~~~~~~~~~~~~~~~~~~~
>> arch/riscv/kernel/usercfi.c:150:1: warning: label 'fault' defined but not used [-Wunused-label]
     150 | fault:
         | ^~~~~
   cc1: some warnings being treated as errors
--
   drivers/perf/riscv_pmu_sbi.c: In function 'pmu_sbi_setup_irqs':
>> drivers/perf/riscv_pmu_sbi.c:1199:37: error: 'RV_IRQ_PMU' undeclared (first use in this function); did you mean 'RV_IRQ_EXT'?
    1199 |                 riscv_pmu_irq_num = RV_IRQ_PMU;
         |                                     ^~~~~~~~~~
         |                                     RV_IRQ_EXT
   drivers/perf/riscv_pmu_sbi.c:1199:37: note: each undeclared identifier is reported only once for each function it appears in
--
>> cc1: error: '-fcf-protection=full' is not supported for this target

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for RISCV_SBI
   Depends on [n]: !RISCV_M_MODE [=y]
   Selected by [y]:
   - RISCV_USER_CFI [=y] && 64BIT [=y] && RISCV_ALTERNATIVE [=y]
   WARNING: unmet direct dependencies detected for ARCH_HAS_ELF_CORE_EFLAGS
   Depends on [n]: BINFMT_ELF [=n] && ELF_CORE [=y]
   Selected by [y]:
   - RISCV [=y]


vim +/__enable_user_access +136 arch/riscv/kernel/usercfi.c

95bae5bc77741e Deepak Gupta 2025-10-15  122  
21515287e36beb Deepak Gupta 2025-10-15  123  /*
21515287e36beb Deepak Gupta 2025-10-15  124   * Writes on shadow stack can either be `sspush` or `ssamoswap`. `sspush` can happen
21515287e36beb Deepak Gupta 2025-10-15  125   * implicitly on current shadow stack pointed to by CSR_SSP. `ssamoswap` takes pointer to
21515287e36beb Deepak Gupta 2025-10-15  126   * shadow stack. To keep it simple, we plan to use `ssamoswap` to perform writes on shadow
21515287e36beb Deepak Gupta 2025-10-15  127   * stack.
21515287e36beb Deepak Gupta 2025-10-15  128   */
21515287e36beb Deepak Gupta 2025-10-15  129  static noinline unsigned long amo_user_shstk(unsigned long *addr, unsigned long val)
21515287e36beb Deepak Gupta 2025-10-15  130  {
21515287e36beb Deepak Gupta 2025-10-15  131  	/*
21515287e36beb Deepak Gupta 2025-10-15  132  	 * Never expect -1 on shadow stack. Expect return addresses and zero
21515287e36beb Deepak Gupta 2025-10-15  133  	 */
21515287e36beb Deepak Gupta 2025-10-15  134  	unsigned long swap = -1;
21515287e36beb Deepak Gupta 2025-10-15  135  
21515287e36beb Deepak Gupta 2025-10-15 @136  	__enable_user_access();
21515287e36beb Deepak Gupta 2025-10-15  137  	asm goto(
21515287e36beb Deepak Gupta 2025-10-15  138  		".option push\n"
21515287e36beb Deepak Gupta 2025-10-15  139  		".option arch, +zicfiss\n"
21515287e36beb Deepak Gupta 2025-10-15 @140  		"1: ssamoswap.d %[swap], %[val], %[addr]\n"
21515287e36beb Deepak Gupta 2025-10-15 @141  		_ASM_EXTABLE(1b, %l[fault])
21515287e36beb Deepak Gupta 2025-10-15  142  		".option pop\n"
21515287e36beb Deepak Gupta 2025-10-15  143  		: [swap] "=r" (swap), [addr] "+A" (*addr)
21515287e36beb Deepak Gupta 2025-10-15  144  		: [val] "r" (val)
21515287e36beb Deepak Gupta 2025-10-15  145  		: "memory"
21515287e36beb Deepak Gupta 2025-10-15  146  		: fault
21515287e36beb Deepak Gupta 2025-10-15  147  		);
21515287e36beb Deepak Gupta 2025-10-15 @148  	__disable_user_access();
21515287e36beb Deepak Gupta 2025-10-15  149  	return swap;
21515287e36beb Deepak Gupta 2025-10-15 @150  fault:
21515287e36beb Deepak Gupta 2025-10-15  151  	__disable_user_access();
21515287e36beb Deepak Gupta 2025-10-15  152  	return -1;
21515287e36beb Deepak Gupta 2025-10-15  153  }
21515287e36beb Deepak Gupta 2025-10-15  154  

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

  parent reply	other threads:[~2025-10-20 18:48 UTC|newest]

Thread overview: 64+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-15 18:13 [PATCH v21 00/28] riscv control-flow integrity for usermode Deepak Gupta
2025-10-15 18:13 ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 01/28] mm: VM_SHADOW_STACK definition for riscv Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 02/28] dt-bindings: riscv: zicfilp and zicfiss in dt-bindings (extensions.yaml) Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 03/28] riscv: zicfiss / zicfilp enumeration Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 04/28] riscv: zicfiss / zicfilp extension csr and bit definitions Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 05/28] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 06/28] riscv/mm : ensure PROT_WRITE leads to VM_READ | VM_WRITE Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 07/28] riscv/mm: manufacture shadow stack pte Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 08/28] riscv/mm: teach pte_mkwrite to manufacture shadow stack PTEs Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 09/28] riscv/mm: write protect and shadow stack Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 10/28] riscv/mm: Implement map_shadow_stack() syscall Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 11/28] riscv/shstk: If needed allocate a new shadow stack on clone Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 12/28] riscv: Implements arch agnostic shadow stack prctls Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 13/28] prctl: arch-agnostic prctl for indirect branch tracking Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 14/28] riscv: Implements arch agnostic indirect branch tracking prctls Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 15/28] riscv/traps: Introduce software check exception and uprobe handling Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 16/28] riscv: signal: abstract header saving for setup_sigcontext Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 17/28] riscv/signal: save and restore of shadow stack for signal Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 18/28] riscv/kernel: update __show_regs to print shadow stack register Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 19/28] riscv/ptrace: riscv cfi status and state via ptrace and in core files Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 20/28] riscv/hwprobe: zicfilp / zicfiss enumeration in hwprobe Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 21/28] riscv: kernel command line option to opt out of user cfi Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 22/28] riscv: enable kernel access to shadow stack memory via FWFT sbi call Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 23/28] arch/riscv: compile vdso with landing pad and shadow stack note Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 24/28] arch/riscv: dual vdso creation logic and select vdso based on hw Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 25/28] riscv: create a config for shadow stack and landing pad instr support Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-16  8:29   ` Zong Li
2025-10-16  8:29     ` Zong Li
2025-10-16 15:31     ` Deepak Gupta
2025-10-16 15:31       ` Deepak Gupta
2025-10-20 18:48   ` kernel test robot [this message]
2025-10-21  2:06   ` kernel test robot
2025-10-15 18:13 ` [PATCH v21 26/28] riscv: Documentation for landing pad / indirect branch tracking Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:13 ` [PATCH v21 27/28] riscv: Documentation for shadow stack on riscv Deepak Gupta
2025-10-15 18:13   ` Deepak Gupta
2025-10-15 18:14 ` [PATCH v21 28/28] kselftest/riscv: kselftest for user mode cfi Deepak Gupta
2025-10-15 18:14   ` Deepak Gupta

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=202510210232.L2yY8OFS-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=debug@rivosinc.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.