public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kbuild test robot <lkp@intel.com>
To: Masami Hiramatsu <mhiramat@kernel.org>
Cc: kbuild-all@01.org, Ingo Molnar <mingo@kernel.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Masami Hiramatsu <mhiramat@kernel.org>,
	"Naveen N . Rao" <naveen.n.rao@linux.ibm.com>,
	Anil S Keshavamurthy <anil.s.keshavamurthy@intel.com>,
	"David S . Miller" <davem@davemloft.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH -tip] kprobes: Prohibit probing on BUG() and WARN() address
Date: Mon, 2 Sep 2019 22:45:56 +0800	[thread overview]
Message-ID: <201909022254.CuIbTcWL%lkp@intel.com> (raw)
In-Reply-To: <156742236963.18000.1855866569667433247.stgit@devnote2>

[-- Attachment #1: Type: text/plain, Size: 3499 bytes --]

Hi Masami,

I love your patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[cannot apply to v5.3-rc6 next-20190902]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Masami-Hiramatsu/kprobes-Prohibit-probing-on-BUG-and-WARN-address/20190902-211736
config: powerpc-defconfig (attached as .config)
compiler: powerpc64-linux-gcc (GCC) 7.4.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # save the attached .config to linux build tree
        GCC_VERSION=7.4.0 make.cross ARCH=powerpc 

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

All warnings (new ones prefixed by >>):

   kernel/kprobes.c: In function 'check_kprobe_address_safe':
>> kernel/kprobes.c:1518:15: warning: passing argument 1 of 'find_bug' makes integer from pointer without a cast [-Wint-conversion]
         find_bug(p->addr)) {
                  ^
   In file included from arch/powerpc/include/asm/mmu.h:130:0,
                    from arch/powerpc/include/asm/lppaca.h:47,
                    from arch/powerpc/include/asm/paca.h:17,
                    from arch/powerpc/include/asm/current.h:13,
                    from include/linux/mutex.h:14,
                    from include/linux/notifier.h:14,
                    from include/linux/kprobes.h:22,
                    from kernel/kprobes.c:21:
   include/linux/bug.h:39:19: note: expected 'long unsigned int' but argument is of type 'kprobe_opcode_t * {aka unsigned int *}'
    struct bug_entry *find_bug(unsigned long bugaddr);
                      ^~~~~~~~

vim +/find_bug +1518 kernel/kprobes.c

  1502	
  1503	static int check_kprobe_address_safe(struct kprobe *p,
  1504					     struct module **probed_mod)
  1505	{
  1506		int ret;
  1507	
  1508		ret = arch_check_ftrace_location(p);
  1509		if (ret)
  1510			return ret;
  1511		jump_label_lock();
  1512		preempt_disable();
  1513	
  1514		/* Ensure it is not in reserved area nor out of text */
  1515		if (!kernel_text_address((unsigned long) p->addr) ||
  1516		    within_kprobe_blacklist((unsigned long) p->addr) ||
  1517		    jump_label_text_reserved(p->addr, p->addr) ||
> 1518		    find_bug(p->addr)) {
  1519			ret = -EINVAL;
  1520			goto out;
  1521		}
  1522	
  1523		/* Check if are we probing a module */
  1524		*probed_mod = __module_text_address((unsigned long) p->addr);
  1525		if (*probed_mod) {
  1526			/*
  1527			 * We must hold a refcount of the probed module while updating
  1528			 * its code to prohibit unexpected unloading.
  1529			 */
  1530			if (unlikely(!try_module_get(*probed_mod))) {
  1531				ret = -ENOENT;
  1532				goto out;
  1533			}
  1534	
  1535			/*
  1536			 * If the module freed .init.text, we couldn't insert
  1537			 * kprobes in there.
  1538			 */
  1539			if (within_module_init((unsigned long)p->addr, *probed_mod) &&
  1540			    (*probed_mod)->state != MODULE_STATE_COMING) {
  1541				module_put(*probed_mod);
  1542				*probed_mod = NULL;
  1543				ret = -ENOENT;
  1544			}
  1545		}
  1546	out:
  1547		preempt_enable();
  1548		jump_label_unlock();
  1549	
  1550		return ret;
  1551	}
  1552	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 25304 bytes --]

  reply	other threads:[~2019-09-02 14:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-02 11:06 [PATCH -tip] kprobes: Prohibit probing on BUG() and WARN() address Masami Hiramatsu
2019-09-02 14:45 ` kbuild test robot [this message]
2019-09-02 15:48 ` kbuild test robot
2019-09-03  9:31   ` Masami Hiramatsu

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=201909022254.CuIbTcWL%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=anil.s.keshavamurthy@intel.com \
    --cc=davem@davemloft.net \
    --cc=kbuild-all@01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mhiramat@kernel.org \
    --cc=mingo@kernel.org \
    --cc=naveen.n.rao@linux.ibm.com \
    --cc=rostedt@goodmis.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