* [arm-integrator:kernel-in-vmalloc-v6.2-rc3-just-ttbr0-split 30/30] arch/arm/include/asm/uaccess.h:54:14: error: call to undeclared function 'current_user_ttbr'; ISO C99 and later do not support implicit function declarations
@ 2023-03-14 14:43 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-03-14 14:43 UTC (permalink / raw)
To: Linus Walleij; +Cc: llvm, oe-kbuild-all
tree: https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kernel-in-vmalloc-v6.2-rc3-just-ttbr0-split
head: 8c7a9ba4d5ab142c56f970395de2c419dbcd0a72
commit: 8c7a9ba4d5ab142c56f970395de2c419dbcd0a72 [30/30] switch PGD/TTBR0 in <asm/uaccess-asm.h>
config: arm-randconfig-r046-20230312 (https://download.01.org/0day-ci/archive/20230314/202303142222.QT4VREFq-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project 67409911353323ca5edf2049ef0df54132fa1ca7)
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
# install arm cross compiling tool for clang build
# apt-get install binutils-arm-linux-gnueabi
# https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git/commit/?id=8c7a9ba4d5ab142c56f970395de2c419dbcd0a72
git remote add arm-integrator https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git
git fetch --no-tags arm-integrator kernel-in-vmalloc-v6.2-rc3-just-ttbr0-split
git checkout 8c7a9ba4d5ab142c56f970395de2c419dbcd0a72
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm prepare
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303142222.QT4VREFq-lkp@intel.com/
All errors (new ones prefixed by >>):
In file included from arch/arm/kernel/asm-offsets.c:12:
In file included from include/linux/mm.h:29:
In file included from include/linux/pgtable.h:6:
In file included from arch/arm/include/asm/pgtable.h:25:
arch/arm/include/asm/pgtable-nommu.h:49:9: warning: 'ZERO_PAGE' macro redefined [-Wmacro-redefined]
#define ZERO_PAGE(vaddr) (virt_to_page((const void *)0))
^
arch/arm/include/asm/pgtable.h:19:9: note: previous definition is here
#define ZERO_PAGE(vaddr) (empty_zero_page)
^
In file included from arch/arm/kernel/asm-offsets.c:12:
In file included from include/linux/mm.h:740:
In file included from include/linux/huge_mm.h:8:
In file included from include/linux/fs.h:33:
In file included from include/linux/percpu-rwsem.h:7:
In file included from include/linux/rcuwait.h:6:
In file included from include/linux/sched/signal.h:9:
In file included from include/linux/sched/task.h:11:
In file included from include/linux/uaccess.h:11:
>> arch/arm/include/asm/uaccess.h:54:14: error: call to undeclared function 'current_user_ttbr'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
user_ttbr = current_user_ttbr();
^
>> arch/arm/include/asm/uaccess.h:55:16: error: call to undeclared function 'read_sysreg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
kernel_ttbr = read_sysreg(TTBR1);
^
>> arch/arm/include/asm/uaccess.h:55:28: error: use of undeclared identifier 'TTBR1'
kernel_ttbr = read_sysreg(TTBR1);
^
>> arch/arm/include/asm/uaccess.h:56:2: error: call to undeclared function 'write_sysreg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
write_sysreg(user_ttbr, TTBR0);
^
>> arch/arm/include/asm/uaccess.h:56:26: error: use of undeclared identifier 'TTBR0'
write_sysreg(user_ttbr, TTBR0);
^
arch/arm/include/asm/uaccess.h:69:2: error: call to undeclared function 'write_sysreg'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
write_sysreg(flags, TTBR0);
^
arch/arm/include/asm/uaccess.h:69:22: error: use of undeclared identifier 'TTBR0'
write_sysreg(flags, TTBR0);
^
1 warning and 7 errors generated.
make[2]: *** [scripts/Makefile.build:114: arch/arm/kernel/asm-offsets.s] Error 1
make[2]: Target 'prepare' not remade because of errors.
make[1]: *** [Makefile:1286: prepare0] Error 2
make[1]: Target 'prepare' not remade because of errors.
make: *** [Makefile:242: __sub-make] Error 2
make: Target 'prepare' not remade because of errors.
vim +/current_user_ttbr +54 arch/arm/include/asm/uaccess.h
28
29 /*
30 * These two functions allow hooking accesses to userspace to increase
31 * system integrity by ensuring that the kernel can not inadvertantly
32 * perform such accesses (eg, via list poison values) which could then
33 * be exploited for priviledge escalation.
34 */
35 static __always_inline unsigned int uaccess_save_and_enable(void)
36 {
37 #ifdef CONFIG_CPU_SW_DOMAIN_PAN
38 unsigned int old_domain = get_domain();
39
40 /* Set the current domain access to permit user accesses */
41 set_domain((old_domain & ~domain_mask(DOMAIN_USER)) |
42 domain_val(DOMAIN_USER, DOMAIN_CLIENT));
43
44 return old_domain;
45 #else
46 /*
47 * Intended semantics: switch to the userspace MM context (enable
48 * userspace), then return (save) the previous kernelspace TTBR0
49 * value.
50 */
51 /* FIXME: ifdef CONFIG_VMSPLIT_4G_4G */
52 u64 user_ttbr, kernel_ttbr;
53
> 54 user_ttbr = current_user_ttbr();
> 55 kernel_ttbr = read_sysreg(TTBR1);
> 56 write_sysreg(user_ttbr, TTBR0);
57
58 return kernel_ttbr;
59 #endif
60 }
61
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-03-14 14:43 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-03-14 14:43 [arm-integrator:kernel-in-vmalloc-v6.2-rc3-just-ttbr0-split 30/30] arch/arm/include/asm/uaccess.h:54:14: error: call to undeclared function 'current_user_ttbr'; ISO C99 and later do not support implicit function declarations kernel test robot
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.