Skip to content

Commit fbc416f

Browse files
arndbctmarinas
authored andcommitted
arm64: fix building without CONFIG_UID16
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. Fixes: af1839e ("Kconfig: clean up the long arch list for the UID16 config option") Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Will Deacon <[email protected]> Cc: [email protected] Signed-off-by: Catalin Marinas <[email protected]>
1 parent 7142392 commit fbc416f

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

include/linux/syscalls.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -524,7 +524,7 @@ asmlinkage long sys_chown(const char __user *filename,
524524
asmlinkage long sys_lchown(const char __user *filename,
525525
uid_t user, gid_t group);
526526
asmlinkage long sys_fchown(unsigned int fd, uid_t user, gid_t group);
527-
#ifdef CONFIG_UID16
527+
#ifdef CONFIG_HAVE_UID16
528528
asmlinkage long sys_chown16(const char __user *filename,
529529
old_uid_t user, old_gid_t group);
530530
asmlinkage long sys_lchown16(const char __user *filename,

include/linux/types.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ typedef __kernel_gid16_t gid16_t;
3535

3636
typedef unsigned long uintptr_t;
3737

38-
#ifdef CONFIG_UID16
38+
#ifdef CONFIG_HAVE_UID16
3939
/* This is defined by include/asm-{arch}/posix_types.h */
4040
typedef __kernel_old_uid_t old_uid_t;
4141
typedef __kernel_old_gid_t old_gid_t;

0 commit comments

Comments
 (0)