lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 13 Oct 2018 17:43:31 +0800
From:   kbuild test robot <lkp@...el.com>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>
Cc:     kbuild-all@...org, Steven Rostedt <rostedt@...dmis.org>,
        linux-kernel@...r.kernel.org,
        Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Ingo Molnar <mingo@...nel.org>,
        Ard Biesheuvel <ard.biesheuvel@...aro.org>,
        Arnd Bergmann <arnd@...db.de>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Bjorn Helgaas <bhelgaas@...gle.com>,
        Catalin Marinas <catalin.marinas@....com>,
        James Morris <james.morris@...rosoft.com>,
        James Morris <jmorris@...ei.org>, Jessica Yu <jeyu@...nel.org>,
        Josh Poimboeuf <jpoimboe@...hat.com>,
        Kees Cook <keescook@...omium.org>,
        Nicolas Pitre <nico@...aro.org>,
        Paul Mackerras <paulus@...ba.org>,
        Petr Mladek <pmladek@...e.com>,
        Russell King <linux@...linux.org.uk>,
        "Serge E. Hallyn" <serge@...lyn.com>,
        Sergey Senozhatsky <sergey.senozhatsky@...il.com>,
        Thomas Garnier <thgarnie@...gle.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Will Deacon <will.deacon@....com>,
        Andrew Morton <akpm@...ux-foundation.org>,
        Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Subject: Re: [PATCH for 4.19] tracepoint: Fix: out-of-bound tracepoint array
 iteration

Hi Mathieu,

I love your patch! Yet something to improve:

[auto build test ERROR on tip/perf/core]
[also build test ERROR on v4.19-rc7 next-20181012]
[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/Mathieu-Desnoyers/tracepoint-Fix-out-of-bound-tracepoint-array-iteration/20181013-073410
config: arm-allyesconfig (attached as .config)
compiler: arm-linux-gnueabi-gcc (Debian 7.2.0-11) 7.2.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.2.0 make.cross ARCH=arm 

All errors (new ones prefixed by >>):

   In file included from kernel/tracepoint.c:18:0:
   include/linux/module.h:433:2: error: unknown type name 'tracepoint_ptr_t'
     tracepoint_ptr_t *tracepoints_ptrs;
     ^~~~~~~~~~~~~~~~
   kernel/tracepoint.c: In function 'tracepoint_module_going':
>> kernel/tracepoint.c:504:30: error: passing argument 1 of 'for_each_tracepoint_range' from incompatible pointer type [-Werror=incompatible-pointer-types]
       for_each_tracepoint_range(mod->tracepoints_ptrs,
                                 ^~~
   kernel/tracepoint.c:374:13: note: expected 'struct tracepoint * const*' but argument is of type 'int *'
    static void for_each_tracepoint_range(
                ^~~~~~~~~~~~~~~~~~~~~~~~~
   kernel/tracepoint.c:505:5: error: passing argument 2 of 'for_each_tracepoint_range' from incompatible pointer type [-Werror=incompatible-pointer-types]
        mod->tracepoints_ptrs + mod->num_tracepoints,
        ^~~
   kernel/tracepoint.c:374:13: note: expected 'struct tracepoint * const*' but argument is of type 'int *'
    static void for_each_tracepoint_range(
                ^~~~~~~~~~~~~~~~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +/for_each_tracepoint_range +504 kernel/tracepoint.c

b75ef8b44 Mathieu Desnoyers        2011-08-10  485  
de7b29739 Mathieu Desnoyers        2014-04-08  486  static void tracepoint_module_going(struct module *mod)
b75ef8b44 Mathieu Desnoyers        2011-08-10  487  {
de7b29739 Mathieu Desnoyers        2014-04-08  488  	struct tp_module *tp_mod;
b75ef8b44 Mathieu Desnoyers        2011-08-10  489  
7dec935a3 Steven Rostedt (Red Hat  2014-02-26  490) 	if (!mod->num_tracepoints)
de7b29739 Mathieu Desnoyers        2014-04-08  491  		return;
7dec935a3 Steven Rostedt (Red Hat  2014-02-26  492) 
de7b29739 Mathieu Desnoyers        2014-04-08  493  	mutex_lock(&tracepoint_module_list_mutex);
de7b29739 Mathieu Desnoyers        2014-04-08  494  	list_for_each_entry(tp_mod, &tracepoint_module_list, list) {
eb7d035c5 Steven Rostedt (Red Hat  2014-04-08  495) 		if (tp_mod->mod == mod) {
de7b29739 Mathieu Desnoyers        2014-04-08  496  			blocking_notifier_call_chain(&tracepoint_notify_list,
de7b29739 Mathieu Desnoyers        2014-04-08  497  					MODULE_STATE_GOING, tp_mod);
de7b29739 Mathieu Desnoyers        2014-04-08  498  			list_del(&tp_mod->list);
de7b29739 Mathieu Desnoyers        2014-04-08  499  			kfree(tp_mod);
de7b29739 Mathieu Desnoyers        2014-04-08  500  			/*
de7b29739 Mathieu Desnoyers        2014-04-08  501  			 * Called the going notifier before checking for
de7b29739 Mathieu Desnoyers        2014-04-08  502  			 * quiescence.
de7b29739 Mathieu Desnoyers        2014-04-08  503  			 */
46e0c9be2 Ard Biesheuvel           2018-08-21 @504  			for_each_tracepoint_range(mod->tracepoints_ptrs,
46e0c9be2 Ard Biesheuvel           2018-08-21  505  				mod->tracepoints_ptrs + mod->num_tracepoints,
46e0c9be2 Ard Biesheuvel           2018-08-21  506  				tp_module_going_check_quiescent, NULL);
b75ef8b44 Mathieu Desnoyers        2011-08-10  507  			break;
b75ef8b44 Mathieu Desnoyers        2011-08-10  508  		}
b75ef8b44 Mathieu Desnoyers        2011-08-10  509  	}
b75ef8b44 Mathieu Desnoyers        2011-08-10  510  	/*
b75ef8b44 Mathieu Desnoyers        2011-08-10  511  	 * In the case of modules that were tainted at "coming", we'll simply
b75ef8b44 Mathieu Desnoyers        2011-08-10  512  	 * walk through the list without finding it. We cannot use the "tainted"
b75ef8b44 Mathieu Desnoyers        2011-08-10  513  	 * flag on "going", in case a module taints the kernel only after being
b75ef8b44 Mathieu Desnoyers        2011-08-10  514  	 * loaded.
b75ef8b44 Mathieu Desnoyers        2011-08-10  515  	 */
de7b29739 Mathieu Desnoyers        2014-04-08  516  	mutex_unlock(&tracepoint_module_list_mutex);
b75ef8b44 Mathieu Desnoyers        2011-08-10  517  }
227a83756 Ingo Molnar              2008-11-16  518  

:::::: The code at line 504 was first introduced by commit
:::::: 46e0c9be206fa7b11aca75da2d6b8535d0139752 kernel: tracepoints: add support for relative references

:::::: TO: Ard Biesheuvel <ard.biesheuvel@...aro.org>
:::::: CC: Linus Torvalds <torvalds@...ux-foundation.org>

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

Download attachment ".config.gz" of type "application/gzip" (66613 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ