From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759832AbbKTLNJ (ORCPT ); Fri, 20 Nov 2015 06:13:09 -0500 Received: from mout.kundenserver.de ([212.227.126.134]:64424 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759163AbbKTLMx (ORCPT ); Fri, 20 Nov 2015 06:12:53 -0500 From: Arnd Bergmann To: will.deacon@arm.com, Catalin Marinas Cc: linux-arm-kernel@lists.infradead.org, linux-arch@vger.kernel.org, akpm@linux-foundation.org, linux-kernel@vger.kernel.org, Michal Simek Subject: [PATCH] ARM64: fix building without CONFIG_UID16 Date: Fri, 20 Nov 2015 12:12:21 +0100 Message-ID: <3891403.6hGat7eHq5@wuerfel> User-Agent: KMail/4.11.5 (Linux/3.16.0-10-generic; KDE/4.11.5; x86_64; ; ) MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-Provags-ID: V03:K0:7XZKFky4o53BS2GiHhQkAw4+9h/z61F9Gh71FpRbGIbhRTmA7Uu 09KPlcJEkn1sWyMvfOs034zGlCF+V58IsHbdWPhX9yLc1A6yWZ4yQuVLs3kq8h4u0vgOBo4 opLyEXlql4gFvSepAEMIkxBb+IbgyEeNxyEN8CWEQhzQ8hwpbviztX00L4sk0a4NXumwyN9 ERt4BdXZuxfhbIHAjVc3Q== X-UI-Out-Filterresults: notjunk:1;V01:K0:6BZT8LR+4xI=:OFiQpmNOspnjiVGUhONmAw iAaUlW672bGh3tcrbo3bSxLoOZ9LXnLGNwhZ4+pVKH6fZ3eZ3LESJOa8v5gK5QM+iqI7pV5aM Ez5kawdT4glnp2Gddokgi7ilVHjBnLr20IGqWTcaHFM6etPAXINe5M/NQOpTPTcPTfzktXirb vUmDIpJbOINk3gM4o0QkJ+LdG4l5/veB2JdPggVZSDM44vVncBuVfHCjY8QpUdb01lUw5kW2c iIYYUdYwKumxyuoA6DRAhIt0H6/mvVjbPXxQdSuSYF9ipbB4EtGfbOaKPmnhPbjG6E0Hyr/4V UqcJnFlv+2jAIX+oympoSf7xQLtkyRE2jc6D1aNbpJUMTjIn032ivfQtiIIMdVKzRCyoqLeH4 MqzYma30UyviAZUPSWgCmjBEmd6JBB9zAiq+Kgtfh1WFUakThegfj/8UlDX3VVSCVOwzH1ZlR r6hZDqvuTx2uN7d0KhSnQKJvmlokW1a67Z1zCHuIq5T4JS2VqkwLsIIFdD9LMUE3iiggEoZlR kfPZJro2VuQa6k/4app+iO1X47oEj8fKTvh/xOsTMKMwilY0U2F9OPXstLfXEjUoqnTGkCjRq oi2+Ah/5zzgXNOGzZMnOuUlR0yQ0HjcEztjKx808eLPZR3sjHMbyE0fwopqpZSRF1s4WSgrLW oaZa8xcFUwtz5UstnlHt55qiKKZ1rRa8WGkRwmE4jhgsv24miSQbx7W/YdHKEA+vm3YH+Wb5F kIMqN+I+Nvhgaddn Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As reported by Michal Simek, building an ARM64 kernel with CONFIG_UID16 disabled currently fails because the system call table still needs to reference the individual function entry points that are provided by kernel/sys_ni.c in this case, and the declarations are hidden inside of #ifdef CONFIG_UID16: arch/arm64/include/asm/unistd32.h:57:8: error: 'sys_lchown16' undeclared here (not in a function) __SYSCALL(__NR_lchown, sys_lchown16) I believe this problem only exists on ARM64, because older architectures tend to not need declarations when their system call table is built in assembly code, while newer architectures tend to not need UID16 support. ARM64 only uses these system calls for compatibility with 32-bit ARM binaries. This changes the CONFIG_UID16 check into CONFIG_HAVE_UID16, which is set unconditionally on ARM64 with CONFIG_COMPAT, so we see the declarations whenever we need them, but otherwise the behavior is unchanged. Signed-off-by: Arnd Bergmann Cc: stable@vger.kernel.org Fixes: af1839eb4bd4 ("Kconfig: clean up the long arch list for the UID16 config option") --- I would suggest merging this through the arm64 tree, as this is likely the only architecture that cares about it, and there is little risk of clashes with other patches in the global headers. The bug goes back to when arch/arm64 was introduced as far as I can tell, but I'm not sure if we care about stable backports or not. I've put stable on Cc anyway, let me know if anyone thinks we should not. diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a156b82dd14c..c2b66a277e98 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h @@ -524,7 +524,7 @@ asmlinkage long sys_chown(const char __user *filename, asmlinkage long sys_lchown(const char __user *filename, uid_t user, gid_t group); asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group); -#ifdef CONFIG_UID16 +#ifdef CONFIG_HAVE_UID16 asmlinkage long sys_chown16(const char __user *filename, old_uid_t user, old_gid_t group); asmlinkage long sys_lchown16(const char __user *filename, diff --git a/include/linux/types.h b/include/linux/types.h index 70d8500bddf1..70dd3dfde631 100644 --- a/include/linux/types.h +++ b/include/linux/types.h @@ -35,7 +35,7 @@ typedef __kernel_gid16_t gid16_t; typedef unsigned long uintptr_t; -#ifdef CONFIG_UID16 +#ifdef CONFIG_HAVE_UID16 /* This is defined by include/asm-{arch}/posix_types.h */ typedef __kernel_old_uid_t old_uid_t; typedef __kernel_old_gid_t old_gid_t;