Re: [memcg:since-4.2 242/301] include/uapi/asm-generic/unistd.h:713:1: error: array index in initializer exceeds array bounds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat 12-09-15 20:22:58, Wu Fengguang wrote:
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/mhocko/mm.git since-4.2
> head:   62799b075621cec2d2a777837187a2885ccd977e
> commit: ad2ff3822c558e410ca3f4bd6ed9f0ea18c59e58 [242/301] mm: mlock: add new mlock system call
> config: openrisc-or1ksim_defconfig (attached as .config)
> reproduce:
>   wget https://git.kernel.org/cgit/linux/kernel/git/wfg/lkp-tests.git/plain/sbin/make.cross -O ~/bin/make.cross
>   chmod +x ~/bin/make.cross
>   git checkout ad2ff3822c558e410ca3f4bd6ed9f0ea18c59e58
>   # save the attached .config to linux build tree
>   make.cross ARCH=openrisc 
> 
> All error/warnings (new ones prefixed by >>):
> 
>    In file included from include/asm-generic/unistd.h:1:0,
>                     from arch/openrisc/include/uapi/asm/unistd.h:26,
>                     from arch/openrisc/kernel/sys_call_table.c:27:
> >> include/uapi/asm-generic/unistd.h:713:1: error: array index in initializer exceeds array bounds
>    include/uapi/asm-generic/unistd.h:713:1: error: (near initialization for 'sys_call_table')
> 
> vim +713 include/uapi/asm-generic/unistd.h
> 
>    707	__SYSCALL(__NR_memfd_create, sys_memfd_create)
>    708	#define __NR_bpf 280
>    709	__SYSCALL(__NR_bpf, sys_bpf)
>    710	#define __NR_execveat 281
>    711	__SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
>    712	#define __NR_mlock2 283
>  > 713	__SYSCALL(__NR_mlock2, sys_mlock2)
>    714	
>    715	#undef __NR_syscalls
>    716	#define __NR_syscalls 283

My fault! I have misapplied the patch. Thanks for catching this up.
Pushed to my tree.
---
>From 177442272f98b7d8b89b1b1adec003c93717dd0a Mon Sep 17 00:00:00 2001
From: Michal Hocko <mhocko@xxxxxxxx>
Date: Mon, 14 Sep 2015 11:37:31 +0200
Subject: [PATCH] Fix misapplied "mm: mlock: add new mlock system call"

__NR_syscalls wasn't updated properly which has been caught by 0-day
compile test:
>> include/uapi/asm-generic/unistd.h:713:1: error: array index in initializer exceeds array bounds
   include/uapi/asm-generic/unistd.h:713:1: error: (near initialization for 'sys_call_table')

vim +713 include/uapi/asm-generic/unistd.h

   707  __SYSCALL(__NR_memfd_create, sys_memfd_create)
   708  #define __NR_bpf 280
   709  __SYSCALL(__NR_bpf, sys_bpf)
   710  #define __NR_execveat 281
   711  __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
   712  #define __NR_mlock2 283
 > 713  __SYSCALL(__NR_mlock2, sys_mlock2)
   714
   715  #undef __NR_syscalls
   716  #define __NR_syscalls 283

The original patch was correct.

Signed-off-by: Michal Hocko <mhocko@xxxxxxxx>
---
 include/uapi/asm-generic/unistd.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h
index a2fe1b92527d..f270a6654f2f 100644
--- a/include/uapi/asm-generic/unistd.h
+++ b/include/uapi/asm-generic/unistd.h
@@ -713,7 +713,7 @@ __SC_COMP(__NR_execveat, sys_execveat, compat_sys_execveat)
 __SYSCALL(__NR_mlock2, sys_mlock2)
 
 #undef __NR_syscalls
-#define __NR_syscalls 283
+#define __NR_syscalls 284
 
 /*
  * All syscalls below here should go away really,
-- 
2.5.0

-- 
Michal Hocko
SUSE Labs

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]