mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org
Subject: [peterz-queue:x86/wip.ibt 42/42] arch/x86/kernel/alternative.c:538:30: warning: passing argument 1 of 'is_endbr' makes integer from pointer without a cast
Date: Thu, 24 Feb 2022 11:42:53 +0800	[thread overview]
Message-ID: <202202241157.jQc2OHWz-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git x86/wip.ibt
head:   27b6438f414b6a37b60dcd90c8980397586d49db
commit: 27b6438f414b6a37b60dcd90c8980397586d49db [42/42] x86/alternative: Use .ibt_endbr_sites to seal indirect calls
config: x86_64-allyesconfig (https://download.01.org/0day-ci/archive/20220224/202202241157.jQc2OHWz-lkp@intel.com/config)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce (this is a W=1 build):
        # https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git/commit/?id=27b6438f414b6a37b60dcd90c8980397586d49db
        git remote add peterz-queue https://git.kernel.org/pub/scm/linux/kernel/git/peterz/queue.git
        git fetch --no-tags peterz-queue x86/wip.ibt
        git checkout 27b6438f414b6a37b60dcd90c8980397586d49db
        # save the config file to linux build tree
        mkdir build_dir
        make W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   In file included from arch/x86/include/asm/bug.h:86,
                    from include/linux/bug.h:5,
                    from include/linux/cpumask.h:14,
                    from arch/x86/include/asm/cpumask.h:5,
                    from arch/x86/include/asm/msr.h:11,
                    from arch/x86/include/asm/processor.h:22,
                    from arch/x86/include/asm/timex.h:5,
                    from include/linux/timex.h:65,
                    from include/linux/time32.h:13,
                    from include/linux/time.h:60,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from arch/x86/kernel/alternative.c:4:
   arch/x86/kernel/alternative.c: In function 'apply_ibt_endbr':
>> arch/x86/kernel/alternative.c:538:30: warning: passing argument 1 of 'is_endbr' makes integer from pointer without a cast [-Wint-conversion]
     538 |   if (WARN_ON_ONCE(!is_endbr(&endbr)))
         |                              ^~~~~~
         |                              |
         |                              u32 * {aka unsigned int *}
   include/asm-generic/bug.h:104:25: note: in definition of macro 'WARN_ON_ONCE'
     104 |  int __ret_warn_on = !!(condition);   \
         |                         ^~~~~~~~~
   In file included from arch/x86/include/asm/linkage.h:6,
                    from include/linux/linkage.h:8,
                    from arch/x86/include/asm/cache.h:5,
                    from include/linux/cache.h:6,
                    from include/linux/time.h:5,
                    from include/linux/stat.h:19,
                    from include/linux/module.h:13,
                    from arch/x86/kernel/alternative.c:4:
   arch/x86/include/asm/ibt.h:34:42: note: expected 'unsigned int' but argument is of type 'u32 *' {aka 'unsigned int *'}
      34 | static inline bool is_endbr(unsigned int val)
         |                             ~~~~~~~~~~~~~^~~


vim +/is_endbr +538 arch/x86/kernel/alternative.c

   523	
   524	/*
   525	 * Generated by: objtool --ibt-seal
   526	 */
   527	void __init_or_module noinline apply_ibt_endbr(s32 *start, s32 *end)
   528	{
   529		s32 *s;
   530	
   531		for (s = start; s < end; s++) {
   532			void *addr = (void *)s + *s;
   533			u32 endbr;
   534	
   535			if (WARN_ON_ONCE(get_kernel_nofault(endbr, addr)))
   536				continue;
   537	
 > 538			if (WARN_ON_ONCE(!is_endbr(&endbr)))
   539				continue;
   540	
   541			DPRINTK("ENDBR at: %pS (%px)", addr, addr);
   542	
   543			/*
   544			 * When we have IBT, the lack of ENDBR will trigger #CP
   545			 * When we don't have IBT, explicitly trigger #UD
   546			 */
   547			DUMP_BYTES(((u8*)addr), 4, "%px: orig: ", addr);
   548			DUMP_BYTES(((u8*)ud1_endbr), 4, "%px: repl: ", addr);
   549			text_poke_early(addr, ud1_endbr, 4);
   550		}
   551	}
   552	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

                 reply	other threads:[~2022-02-24  3:43 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=202202241157.jQc2OHWz-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    /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

all inboxes | Powered by JetHome®