llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [arm-integrator:kernel-in-vmalloc-v6.4-rc1-just-ttbr0-split 23/26] arch/arm/include/asm/uaccess.h:45:2: warning: use of a '#elifdef' directive is a C2x extension
@ 2023-06-30  1:20 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-06-30  1:20 UTC (permalink / raw)
  To: Linus Walleij; +Cc: llvm, oe-kbuild-all

Hi Linus,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-integrator.git kernel-in-vmalloc-v6.4-rc1-just-ttbr0-split
head:   d0cf2fe7497259ee8a7308da99a8cbafaab5e5b5
commit: f568e0b0cf6225d4d5a6fc568d94e7f64f24b9d6 [23/26] ARM: kernel/userspace address separation
config: arm-randconfig-r036-20230630 (https://download.01.org/0day-ci/archive/20230630/202306300935.VrmUlMGL-lkp@intel.com/config)
compiler: clang version 17.0.0 (https://github.com/llvm/llvm-project.git 4a5ac14ee968ff0ad5d2cc1ffa0299048db4c88a)
reproduce: (https://download.01.org/0day-ci/archive/20230630/202306300935.VrmUlMGL-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306300935.VrmUlMGL-lkp@intel.com/

All warnings (new ones prefixed by >>):

   In file included from arch/arm/kernel/asm-offsets.c:12:
   In file included from include/linux/mm.h:976:
   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:45:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      45 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   arch/arm/include/asm/uaccess.h:68:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      68 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   2 warnings generated.
--
   In file included from drivers/platform/goldfish/goldfish_pipe.c:57:
   In file included from include/linux/poll.h:10:
   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:45:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      45 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   arch/arm/include/asm/uaccess.h:68:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      68 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   drivers/platform/goldfish/goldfish_pipe.c:926:36: warning: unused variable 'goldfish_pipe_acpi_match' [-Wunused-const-variable]
     926 | static const struct acpi_device_id goldfish_pipe_acpi_match[] = {
         |                                    ^
   3 warnings generated.
--
   In file included from arch/arm/kernel/asm-offsets.c:12:
   In file included from include/linux/mm.h:976:
   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:45:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      45 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   arch/arm/include/asm/uaccess.h:68:2: warning: use of a '#elifdef' directive is a C2x extension [-Wc2x-extensions]
      68 | #elifdef CONFIG_ARM_KERNEL_SEPARATION
         |  ^
   2 warnings generated.


vim +45 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	#elifdef CONFIG_ARM_KERNEL_SEPARATION
    46		/*
    47		 * Intended semantics: switch to the userspace MM context (enable
    48		 * userspace), then return (save) the previous kernelspace TTBR0
    49		 * value.
    50		 */
    51		u64 user_ttbr, kernel_ttbr;
    52	
    53		user_ttbr = current_user_ttbr();
    54		kernel_ttbr = read_sysreg(TTBR1);
    55		write_sysreg(user_ttbr, TTBR0);
    56	
    57		return kernel_ttbr;
    58	#else
    59		return 0;
    60	#endif
    61	}
    62	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-30  1:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-30  1:20 [arm-integrator:kernel-in-vmalloc-v6.4-rc1-just-ttbr0-split 23/26] arch/arm/include/asm/uaccess.h:45:2: warning: use of a '#elifdef' directive is a C2x extension kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).