Re: [PATCH] ARC: fix CONFIG_HARDENED_USERCOPY

2021-06-10 Thread Kees Cook
On Wed, Jun 09, 2021 at 03:12:11PM -0700, Vineet Gupta wrote: > Currently enabling this triggers a warning > > | usercopy: Kernel memory overwrite attempt detected to kernel text (offset > 155633, size 11)! > | usercopy: BUG: failure at mm/usercopy.c:99/usercopy_abort()! > | > |gcc generated __bu

[linux-next:master 8465/8758] arch/arc/kernel/signal.c:101:21: error: 'struct pt_regs' has no member named 'r30'; did you mean 'r10'?

2021-06-10 Thread kernel test robot
config: arc-randconfig-r001-20210610 (attached as .config) compiler: arceb-elf-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://git.kernel.org

Re: [PATCH] ARC: fix CONFIG_HARDENED_USERCOPY

2021-06-10 Thread Vineet Gupta
On 6/10/21 10:02 AM, Kees Cook wrote: > On Wed, Jun 09, 2021 at 03:12:11PM -0700, Vineet Gupta wrote: >> Currently enabling this triggers a warning >> >> | usercopy: Kernel memory overwrite attempt detected to kernel text (offset >> 155633, size 11)! >> | usercopy: BUG: failure at mm/usercopy.c:99

[PATCH v2] ARCv2: save ABI registers across signal handling

2021-06-10 Thread Vineet Gupta
ARCv2 has some configuration dependent registers (r30, r58, r59) which could be targetted by the compiler. To keep the ABI stable, these were unconditionally part of the glibc ABI (sysdeps/unix/sysv/linux/arc/sys/ucontext.h:mcontext_t) however we missed populating them (by saving/restoring them acr

Re: [PATCH] ARC: fix CONFIG_HARDENED_USERCOPY

2021-06-10 Thread Kees Cook
On Thu, Jun 10, 2021 at 06:56:48PM +, Vineet Gupta wrote: > On 6/10/21 10:02 AM, Kees Cook wrote: > > On Wed, Jun 09, 2021 at 03:12:11PM -0700, Vineet Gupta wrote: > >> Currently enabling this triggers a warning > >> > >> | usercopy: Kernel memory overwrite attempt detected to kernel text > >>

Re: [linux-next:master 8465/8758] arch/arc/kernel/signal.c:101:21: error: 'struct pt_regs' has no member named 'r30'; did you mean 'r10'?

2021-06-10 Thread Vineet Gupta
t/next/linux-next.git__;!!A4F2R9G_pg!OKqfde4ua3ZrR7XYJtEqASSTLKtjW1iEEeBD5V38iLgNZ9l3CBkaluPc9FDW_E5l$ > master > head: 50a1180e6cf12462bbbf3f2ebc5b93094ed9abee > commit: 98ec2edf58c820ef953fbdfcf98d706aa804b822 [8465/8758] ARCv2: save ABI > registers across signal handling > config:

Re: [PATCH] ARC: fix CONFIG_HARDENED_USERCOPY

2021-06-10 Thread Vineet Gupta
On 6/10/21 4:56 PM, Kees Cook wrote: |Stack Trace: | memfd_fcntl+0x0/0x470 | usercopy_abort+0x8a/0x8c | __check_object_size+0x10e/0x138 | copy_strings+0x1f4/0x38c | __do_execve_file+0x352/0x848 | EV_Trap+0xcc/0xd0 >>> What was the root cause here? Was it that the