All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: Re: [RFC PATCH] riscv: add VMAP_STACK overflow detection
Date: Fri, 07 May 2021 21:22:43 +0800	[thread overview]
Message-ID: <202105072118.17TdYJjZ-lkp@intel.com> (raw)
In-Reply-To: <20210507092509.41346-1-tongtiangen@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 5861 bytes --]

Hi Tong,

[FYI, it's a private test report for your RFC patch.]
[auto build test ERROR on v5.12]
[also build test ERROR on next-20210507]
[cannot apply to linus/master]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Tong-Tiangen/riscv-add-VMAP_STACK-overflow-detection/20210507-171736
base:    9f4ad9e425a1d3b6a34617b8ea226d56a119a717
config: riscv-rv32_defconfig (attached as .config)
compiler: riscv32-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://github.com/0day-ci/linux/commit/60d8a3da002bf59ec0abeb88403dbb11cf31583f
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Tong-Tiangen/riscv-add-VMAP_STACK-overflow-detection/20210507-171736
        git checkout 60d8a3da002bf59ec0abeb88403dbb11cf31583f
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=riscv 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All errors (new ones prefixed by >>):

   arch/riscv/kernel/entry.S: Assembler messages:
>> arch/riscv/kernel/entry.S:416: Error: unrecognized opcode `sd a0,-8(sp)'
>> arch/riscv/kernel/entry.S:436: Error: unrecognized opcode `ld sp,-8(sp)'


vim +416 arch/riscv/kernel/entry.S

   352	
   353	work_pending:
   354		/* Enter slow path for supplementary processing */
   355		la ra, ret_from_exception
   356		andi s1, s0, _TIF_NEED_RESCHED
   357		bnez s1, work_resched
   358	work_notifysig:
   359		/* Handle pending signals and notify-resume requests */
   360		csrs CSR_STATUS, SR_IE /* Enable interrupts for do_notify_resume() */
   361		move a0, sp /* pt_regs */
   362		move a1, s0 /* current_thread_info->flags */
   363		tail do_notify_resume
   364	work_resched:
   365		tail schedule
   366	
   367	/* Slow paths for ptrace. */
   368	handle_syscall_trace_enter:
   369		move a0, sp
   370		call do_syscall_trace_enter
   371		move t0, a0
   372		REG_L a0, PT_A0(sp)
   373		REG_L a1, PT_A1(sp)
   374		REG_L a2, PT_A2(sp)
   375		REG_L a3, PT_A3(sp)
   376		REG_L a4, PT_A4(sp)
   377		REG_L a5, PT_A5(sp)
   378		REG_L a6, PT_A6(sp)
   379		REG_L a7, PT_A7(sp)
   380		bnez t0, ret_from_syscall_rejected
   381		j check_syscall_nr
   382	handle_syscall_trace_exit:
   383		move a0, sp
   384		call do_syscall_trace_exit
   385		j ret_from_exception
   386	
   387	#ifdef CONFIG_VMAP_STACK
   388	handle_kernel_stack_overflow:
   389		la sp, shadow_stack
   390		addi sp, sp, SHADOW_OVERFLOW_STACK_SIZE
   391	
   392		//save caller register to shadow stack
   393		addi sp, sp, -(PT_SIZE_ON_STACK)
   394		REG_S x1,  PT_RA(sp)
   395		REG_S x5,  PT_T0(sp)
   396		REG_S x6,  PT_T1(sp)
   397		REG_S x7,  PT_T2(sp)
   398		REG_S x10, PT_A0(sp)
   399		REG_S x11, PT_A1(sp)
   400		REG_S x12, PT_A2(sp)
   401		REG_S x13, PT_A3(sp)
   402		REG_S x14, PT_A4(sp)
   403		REG_S x15, PT_A5(sp)
   404		REG_S x16, PT_A6(sp)
   405		REG_S x17, PT_A7(sp)
   406		REG_S x28, PT_T3(sp)
   407		REG_S x29, PT_T4(sp)
   408		REG_S x30, PT_T5(sp)
   409		REG_S x31, PT_T6(sp)
   410	
   411		la ra, restore_caller_reg
   412		tail get_overflow_stack
   413	
   414	restore_caller_reg:
   415		//save per-cpu overflow stack
 > 416		sd a0, -8(sp)
   417		//restore caller register from shadow_stack
   418		REG_L x1,  PT_RA(sp)
   419		REG_L x5,  PT_T0(sp)
   420		REG_L x6,  PT_T1(sp)
   421		REG_L x7,  PT_T2(sp)
   422		REG_L x10, PT_A0(sp)
   423		REG_L x11, PT_A1(sp)
   424		REG_L x12, PT_A2(sp)
   425		REG_L x13, PT_A3(sp)
   426		REG_L x14, PT_A4(sp)
   427		REG_L x15, PT_A5(sp)
   428		REG_L x16, PT_A6(sp)
   429		REG_L x17, PT_A7(sp)
   430		REG_L x28, PT_T3(sp)
   431		REG_L x29, PT_T4(sp)
   432		REG_L x30, PT_T5(sp)
   433		REG_L x31, PT_T6(sp)
   434	
   435		//load per-cpu overflow stack
 > 436		ld sp, -8(sp)
   437		addi sp, sp, -(PT_SIZE_ON_STACK)
   438	
   439		//save context to overflow stack
   440		REG_S x1,  PT_RA(sp)
   441		REG_S x3,  PT_GP(sp)
   442		REG_S x5,  PT_T0(sp)
   443		REG_S x6,  PT_T1(sp)
   444		REG_S x7,  PT_T2(sp)
   445		REG_S x8,  PT_S0(sp)
   446		REG_S x9,  PT_S1(sp)
   447		REG_S x10, PT_A0(sp)
   448		REG_S x11, PT_A1(sp)
   449		REG_S x12, PT_A2(sp)
   450		REG_S x13, PT_A3(sp)
   451		REG_S x14, PT_A4(sp)
   452		REG_S x15, PT_A5(sp)
   453		REG_S x16, PT_A6(sp)
   454		REG_S x17, PT_A7(sp)
   455		REG_S x18, PT_S2(sp)
   456		REG_S x19, PT_S3(sp)
   457		REG_S x20, PT_S4(sp)
   458		REG_S x21, PT_S5(sp)
   459		REG_S x22, PT_S6(sp)
   460		REG_S x23, PT_S7(sp)
   461		REG_S x24, PT_S8(sp)
   462		REG_S x25, PT_S9(sp)
   463		REG_S x26, PT_S10(sp)
   464		REG_S x27, PT_S11(sp)
   465		REG_S x28, PT_T3(sp)
   466		REG_S x29, PT_T4(sp)
   467		REG_S x30, PT_T5(sp)
   468		REG_S x31, PT_T6(sp)
   469	
   470		REG_L s0, TASK_TI_KERNEL_SP(tp)
   471		csrr s1, CSR_STATUS
   472		csrr s2, CSR_EPC
   473		csrr s3, CSR_TVAL
   474		csrr s4, CSR_CAUSE
   475		csrr s5, CSR_SCRATCH
   476		REG_S s0, PT_SP(sp)
   477		REG_S s1, PT_STATUS(sp)
   478		REG_S s2, PT_EPC(sp)
   479		REG_S s3, PT_BADADDR(sp)
   480		REG_S s4, PT_CAUSE(sp)
   481		REG_S s5, PT_TP(sp)
   482		move a0, sp
   483		tail handle_bad_stack
   484	#endif
   485	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 20565 bytes --]

  parent reply	other threads:[~2021-05-07 13:22 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07  9:25 [RFC PATCH] riscv: add VMAP_STACK overflow detection Tong Tiangen
2021-05-07  9:25 ` Tong Tiangen
2021-05-07 12:00 ` kernel test robot
2021-05-07 12:37 ` kernel test robot
2021-05-07 13:22 ` kernel test robot [this message]
2021-05-23  1:49 ` Palmer Dabbelt
2021-05-23  1:49   ` Palmer Dabbelt
2021-05-24 13:51   ` tongtiangen
2021-05-24 13:51     ` tongtiangen

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=202105072118.17TdYJjZ-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.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 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.