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>] [day] [month] [year] [list]
Message-ID: <202206120045.FwSlNqBY-lkp@intel.com>
Date:   Sun, 12 Jun 2022 00:12:22 +0800
From:   kernel test robot <lkp@...el.com>
To:     Jonathan McDowell <noodles@...com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Mimi Zohar <zohar@...ux.ibm.com>, Baoquan He <bhe@...hat.com>
Subject: [daveh-devel:testme 2/2] drivers/of/kexec.c:126:5: warning: no
 previous prototype for 'ima_get_kexec_buffer'

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git testme
head:   a217a1ebac788fd28ccf79499e9e12e5519d70b7
commit: a217a1ebac788fd28ccf79499e9e12e5519d70b7 [2/2] x86/kexec: Carry forward IMA measurement log on kexec
config: parisc-randconfig-r023-20220611 (https://download.01.org/0day-ci/archive/20220612/202206120045.FwSlNqBY-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 11.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git/commit/?id=a217a1ebac788fd28ccf79499e9e12e5519d70b7
        git remote add daveh-devel https://git.kernel.org/pub/scm/linux/kernel/git/daveh/devel.git
        git fetch --no-tags daveh-devel testme
        git checkout a217a1ebac788fd28ccf79499e9e12e5519d70b7
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.3.0 make.cross W=1 O=build_dir ARCH=parisc SHELL=/bin/bash drivers/of/

If you fix the issue, kindly add following tag where applicable
Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/of/kexec.c:126:5: warning: no previous prototype for 'ima_get_kexec_buffer' [-Wmissing-prototypes]
     126 | int ima_get_kexec_buffer(void **addr, size_t *size)
         |     ^~~~~~~~~~~~~~~~~~~~
>> drivers/of/kexec.c:153:5: warning: no previous prototype for 'ima_free_kexec_buffer' [-Wmissing-prototypes]
     153 | int ima_free_kexec_buffer(void)
         |     ^~~~~~~~~~~~~~~~~~~~~


vim +/ima_get_kexec_buffer +126 drivers/of/kexec.c

fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  118  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  119  /**
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  120   * ima_get_kexec_buffer - get IMA buffer from the previous kernel
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  121   * @addr:	On successful return, set to point to the buffer contents.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  122   * @size:	On successful return, set to the buffer size.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  123   *
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  124   * Return: 0 on success, negative errno on error.
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  125   */
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21 @126  int ima_get_kexec_buffer(void **addr, size_t *size)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  127  {
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  128  	int ret, len;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  129  	unsigned long tmp_addr;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  130  	size_t tmp_size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  131  	const void *prop;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  132  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  133  	if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  134  		return -ENOTSUPP;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  135  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  136  	prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  137  	if (!prop)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  138  		return -ENOENT;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  139  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  140  	ret = do_get_kexec_buffer(prop, len, &tmp_addr, &tmp_size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  141  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  142  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  143  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  144  	*addr = __va(tmp_addr);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  145  	*size = tmp_size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  146  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  147  	return 0;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  148  }
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  149  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  150  /**
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  151   * ima_free_kexec_buffer - free memory used by the IMA buffer
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  152   */
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21 @153  int ima_free_kexec_buffer(void)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  154  {
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  155  	int ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  156  	unsigned long addr;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  157  	size_t size;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  158  	struct property *prop;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  159  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  160  	if (!IS_ENABLED(CONFIG_HAVE_IMA_KEXEC))
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  161  		return -ENOTSUPP;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  162  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  163  	prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  164  	if (!prop)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  165  		return -ENOENT;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  166  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  167  	ret = do_get_kexec_buffer(prop->value, prop->length, &addr, &size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  168  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  169  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  170  
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  171  	ret = of_remove_property(of_chosen, prop);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  172  	if (ret)
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  173  		return ret;
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  174  
3ecc68349bbab6 Mike Rapoport           2021-11-05  175  	return memblock_phys_free(addr, size);
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  176  }
fee3ff99bc6760 Lakshmi Ramasubramanian 2021-02-21  177  

:::::: The code at line 126 was first introduced by commit
:::::: fee3ff99bc67604fba77f19da0106f3ec52b1956 powerpc: Move arch independent ima kexec functions to drivers/of/kexec.c

:::::: TO: Lakshmi Ramasubramanian <nramas@...ux.microsoft.com>
:::::: CC: Rob Herring <robh@...nel.org>

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ