From: kernel test robot <lkp@intel.com>
To: Deepak Gupta <debug@rivosinc.com>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
Andrew Morton <akpm@linux-foundation.org>,
"Liam R. Howlett" <Liam.Howlett@oracle.com>,
Vlastimil Babka <vbabka@suse.cz>,
Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
Paul Walmsley <paul.walmsley@sifive.com>,
Palmer Dabbelt <palmer@dabbelt.com>,
Albert Ou <aou@eecs.berkeley.edu>,
Conor Dooley <conor@kernel.org>, Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Christian Brauner <brauner@kernel.org>,
Oleg Nesterov <oleg@redhat.com>,
Eric Biederman <ebiederm@xmission.com>,
Kees Cook <kees@kernel.org>, Jonathan Corbet <corbet@lwn.net>,
Shuah Khan <skhan@linuxfoundation.org>,
Jann Horn <jannh@google.com>, Miguel Ojeda <ojeda@kernel.org>,
Alex Gaynor <alex.gaynor@gmail.com>,
Boqun Feng <boqun.feng@gmail.com>, Gary Guo <gary@garyguo.net>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev,
Linux Memory Management List <linux-mm@kvack.org>
Subject: Re: [PATCH v14 11/27] riscv/shstk: If needed allocate a new shadow stack on clone
Date: Fri, 2 May 2025 00:12:19 +0800 [thread overview]
Message-ID: <202505012340.bnGnBAW6-lkp@intel.com> (raw)
In-Reply-To: <20250429-v5_user_cfi_series-v14-11-5239410d012a@rivosinc.com>
Hi Deepak,
kernel test robot noticed the following build warnings:
[auto build test WARNING on 4181f8ad7a1061efed0219951d608d4988302af7]
url: https://github.com/intel-lab-lkp/linux/commits/Deepak-Gupta/mm-VM_SHADOW_STACK-definition-for-riscv/20250430-082727
base: 4181f8ad7a1061efed0219951d608d4988302af7
patch link: https://lore.kernel.org/r/20250429-v5_user_cfi_series-v14-11-5239410d012a%40rivosinc.com
patch subject: [PATCH v14 11/27] riscv/shstk: If needed allocate a new shadow stack on clone
config: riscv-randconfig-001-20250501 (https://download.01.org/0day-ci/archive/20250501/202505012340.bnGnBAW6-lkp@intel.com/config)
compiler: clang version 21.0.0git (https://github.com/llvm/llvm-project f819f46284f2a79790038e1f6649172789734ae8)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250501/202505012340.bnGnBAW6-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/202505012340.bnGnBAW6-lkp@intel.com/
All warnings (new ones prefixed by >>):
>> arch/riscv/kernel/process.c:245:36: warning: expression result unused [-Wunused-value]
245 | ssp ? set_active_shstk(p, ssp) : 0;
| ^
1 warning generated.
vim +245 arch/riscv/kernel/process.c
209
210 int copy_thread(struct task_struct *p, const struct kernel_clone_args *args)
211 {
212 unsigned long clone_flags = args->flags;
213 unsigned long usp = args->stack;
214 unsigned long tls = args->tls;
215 unsigned long ssp = 0;
216 struct pt_regs *childregs = task_pt_regs(p);
217
218 /* Ensure all threads in this mm have the same pointer masking mode. */
219 if (IS_ENABLED(CONFIG_RISCV_ISA_SUPM) && p->mm && (clone_flags & CLONE_VM))
220 set_bit(MM_CONTEXT_LOCK_PMLEN, &p->mm->context.flags);
221
222 memset(&p->thread.s, 0, sizeof(p->thread.s));
223
224 /* p->thread holds context to be restored by __switch_to() */
225 if (unlikely(args->fn)) {
226 /* Kernel thread */
227 memset(childregs, 0, sizeof(struct pt_regs));
228 /* Supervisor/Machine, irqs on: */
229 childregs->status = SR_PP | SR_PIE;
230
231 p->thread.s[0] = (unsigned long)args->fn;
232 p->thread.s[1] = (unsigned long)args->fn_arg;
233 } else {
234 /* allocate new shadow stack if needed. In case of CLONE_VM we have to */
235 ssp = shstk_alloc_thread_stack(p, args);
236 if (IS_ERR_VALUE(ssp))
237 return PTR_ERR((void *)ssp);
238
239 *childregs = *(current_pt_regs());
240 /* Turn off status.VS */
241 riscv_v_vstate_off(childregs);
242 if (usp) /* User fork */
243 childregs->sp = usp;
244 /* if needed, set new ssp */
> 245 ssp ? set_active_shstk(p, ssp) : 0;
246 if (clone_flags & CLONE_SETTLS)
247 childregs->tp = tls;
248 childregs->a0 = 0; /* Return value of fork() */
249 p->thread.s[0] = 0;
250 }
251 p->thread.riscv_v_flags = 0;
252 if (has_vector() || has_xtheadvector())
253 riscv_v_thread_alloc(p);
254 p->thread.ra = (unsigned long)ret_from_fork;
255 p->thread.sp = (unsigned long)childregs; /* kernel sp */
256 return 0;
257 }
258
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
next prev parent reply other threads:[~2025-05-01 16:13 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-04-30 0:16 [PATCH v14 00/27] riscv control-flow integrity for usermode Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 01/27] mm: VM_SHADOW_STACK definition for riscv Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 02/27] dt-bindings: riscv: zicfilp and zicfiss in dt-bindings (extensions.yaml) Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 03/27] riscv: zicfiss / zicfilp enumeration Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 04/27] riscv: zicfiss / zicfilp extension csr and bit definitions Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 05/27] riscv: usercfi state for task and save/restore of CSR_SSP on trap entry/exit Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 06/27] riscv/mm : ensure PROT_WRITE leads to VM_READ | VM_WRITE Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 07/27] riscv mm: manufacture shadow stack pte Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 08/27] riscv mmu: teach pte_mkwrite to manufacture shadow stack PTEs Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 09/27] riscv mmu: write protect and shadow stack Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 10/27] riscv/mm: Implement map_shadow_stack() syscall Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 11/27] riscv/shstk: If needed allocate a new shadow stack on clone Deepak Gupta
2025-05-01 16:12 ` kernel test robot [this message]
2025-04-30 0:16 ` [PATCH v14 12/27] riscv: Implements arch agnostic shadow stack prctls Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 13/27] prctl: arch-agnostic prctl for indirect branch tracking Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 14/27] riscv: Implements arch agnostic indirect branch tracking prctls Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 15/27] riscv/traps: Introduce software check exception Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 16/27] riscv: signal: abstract header saving for setup_sigcontext Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 17/27] riscv/signal: save and restore of shadow stack for signal Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 18/27] riscv/kernel: update __show_regs to print shadow stack register Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 19/27] riscv/ptrace: riscv cfi status and state via ptrace and in core files Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 20/27] riscv/hwprobe: zicfilp / zicfiss enumeration in hwprobe Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 21/27] riscv: kernel command line option to opt out of user cfi Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 22/27] riscv: enable kernel access to shadow stack memory via FWFT sbi call Deepak Gupta
2025-05-01 19:39 ` kernel test robot
2025-05-01 19:50 ` kernel test robot
2025-04-30 0:16 ` [PATCH v14 23/27] arch/riscv: compile vdso with landing pad Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 24/27] riscv: create a config for shadow stack and landing pad instr support Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 25/27] riscv: Documentation for landing pad / indirect branch tracking Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 26/27] riscv: Documentation for shadow stack on riscv Deepak Gupta
2025-04-30 0:16 ` [PATCH v14 27/27] kselftest/riscv: kselftest for user mode cfi 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=202505012340.bnGnBAW6-lkp@intel.com \
--to=lkp@intel.com \
--cc=Liam.Howlett@oracle.com \
--cc=akpm@linux-foundation.org \
--cc=alex.gaynor@gmail.com \
--cc=aou@eecs.berkeley.edu \
--cc=arnd@arndb.de \
--cc=boqun.feng@gmail.com \
--cc=bp@alien8.de \
--cc=brauner@kernel.org \
--cc=conor@kernel.org \
--cc=corbet@lwn.net \
--cc=dave.hansen@linux.intel.com \
--cc=debug@rivosinc.com \
--cc=ebiederm@xmission.com \
--cc=gary@garyguo.net \
--cc=hpa@zytor.com \
--cc=jannh@google.com \
--cc=kees@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-mm@kvack.org \
--cc=llvm@lists.linux.dev \
--cc=lorenzo.stoakes@oracle.com \
--cc=mingo@redhat.com \
--cc=oe-kbuild-all@lists.linux.dev \
--cc=ojeda@kernel.org \
--cc=oleg@redhat.com \
--cc=palmer@dabbelt.com \
--cc=paul.walmsley@sifive.com \
--cc=robh@kernel.org \
--cc=skhan@linuxfoundation.org \
--cc=tglx@linutronix.de \
--cc=vbabka@suse.cz \
--cc=x86@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