llvm.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: llvm@lists.linux.dev, oe-kbuild-all@lists.linux.dev
Subject: [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
Date: Fri, 30 Jun 2023 09:20:45 +0800	[thread overview]
Message-ID: <202306300935.VrmUlMGL-lkp@intel.com> (raw)

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

                 reply	other threads:[~2023-06-30  1:21 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202306300935.VrmUlMGL-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=linus.walleij@linaro.org \
    --cc=llvm@lists.linux.dev \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).