Re: [PATCH V3 5/6] Update the Kconfig to support carrying forward the IMA Measurement log and and update the setup_dtb call to add the linux,ima-kexec-buffer property to the DTB.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Prakhar,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on arm64/for-next/core]
[also build test WARNING on powerpc/next integrity/next-integrity v5.8-rc6 next-20200720]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Prakhar-Srivastava/Add-support-to-carry-forward-the-IMA-measurement-logs/20200720-232521
base:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core
config: arm64-allyesconfig (attached as .config)
compiler: aarch64-linux-gcc (GCC) 9.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
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=arm64 

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

All warnings (new ones prefixed by >>):

>> security/integrity/ima/ima_kexec.c:49:5: warning: no previous prototype for 'ima_get_kexec_buffer' [-Wmissing-prototypes]
      49 | int ima_get_kexec_buffer(void **addr, size_t *size)
         |     ^~~~~~~~~~~~~~~~~~~~
>> security/integrity/ima/ima_kexec.c:73:5: warning: no previous prototype for 'ima_free_kexec_buffer' [-Wmissing-prototypes]
      73 | int ima_free_kexec_buffer(void)
         |     ^~~~~~~~~~~~~~~~~~~~~
   security/integrity/ima/ima_kexec.c:161:6: warning: no previous prototype for 'ima_add_kexec_buffer' [-Wmissing-prototypes]
     161 | void ima_add_kexec_buffer(struct kimage *image)
         |      ^~~~~~~~~~~~~~~~~~~~

vim +/ima_get_kexec_buffer +49 security/integrity/ima/ima_kexec.c

0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  41  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  42  /**
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  43   * ima_get_kexec_buffer - get IMA buffer from the previous kernel
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  44   * @addr:	On successful return, set to point to the buffer contents.
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  45   * @size:	On successful return, set to the buffer size.
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  46   *
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  47   * Return: 0 on success, negative errno on error.
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  48   */
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20 @49  int ima_get_kexec_buffer(void **addr, size_t *size)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  50  {
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  51  	int ret, len;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  52  	unsigned long tmp_addr;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  53  	size_t tmp_size;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  54  	const void *prop;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  55  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  56  	prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  57  	if (!prop)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  58  		return -ENOENT;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  59  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  60  	ret = do_get_kexec_buffer(prop, len, &tmp_addr, &tmp_size);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  61  	if (ret)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  62  		return ret;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  63  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  64  	*addr = __va(tmp_addr);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  65  	*size = tmp_size;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  66  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  67  	return 0;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  68  }
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  69  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  70  /**
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  71   * ima_free_kexec_buffer - free memory used by the IMA buffer
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  72   */
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20 @73  int ima_free_kexec_buffer(void)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  74  {
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  75  	int ret;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  76  	unsigned long addr;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  77  	size_t size;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  78  	struct property *prop;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  79  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  80  	prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  81  	if (!prop)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  82  		return -ENOENT;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  83  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  84  	ret = do_get_kexec_buffer(prop->value, prop->length, &addr, &size);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  85  	if (ret)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  86  		return ret;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  87  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  88  	ret = of_remove_property(of_chosen, prop);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  89  	if (ret)
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  90  		return ret;
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  91  
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  92  	return memblock_free(addr, size);
0cc3b50ba7b5c5 Prakhar Srivastava 2020-07-20  93  

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

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Device Tree Compilter]     [Device Tree Spec]     [Linux Driver Backports]     [Video for Linux]     [Linux USB Devel]     [Linux PCI Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Yosemite Backpacking]


  Powered by Linux