public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Prakhar Srivastava <prsriva@linux.microsoft.com>,
	linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org,
	devicetree@vger.kernel.org, linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org
Cc: kbuild-all@lists.01.org, kstewart@linuxfoundation.org,
	mark.rutland@arm.com, catalin.marinas@arm.com,
	bhsharma@redhat.com
Subject: Re: [v1 PATCH 1/2] Refactoring carrying over IMA measuremnet logs over Kexec.
Date: Mon, 8 Jun 2020 10:29:53 +0800	[thread overview]
Message-ID: <202006081015.aeZcpHB7%lkp@intel.com> (raw)
In-Reply-To: <20200607233323.22375-2-prsriva@linux.microsoft.com>

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

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 soc/for-next v5.7 next-20200605]
[if your patch is applied to the wrong git tree, please drop us a note to help
improve the system. BTW, we also suggest to use '--base' option to specify the
base tree in git format-patch, please see https://stackoverflow.com/a/37406982]

url:    https://github.com/0day-ci/linux/commits/Prakhar-Srivastava/Adding-support-to-carry-IMA-measurement-logs/20200608-073805
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@intel.com>

All warnings (new ones prefixed by >>, old ones prefixed by <<):

>> security/integrity/ima/ima_kexec.c:59:5: warning: no previous prototype for 'ima_get_kexec_buffer' [-Wmissing-prototypes]
59 | int ima_get_kexec_buffer(void **addr, size_t *size)
|     ^~~~~~~~~~~~~~~~~~~~
>> security/integrity/ima/ima_kexec.c:85:5: warning: no previous prototype for 'delete_fdt_mem_rsv' [-Wmissing-prototypes]
85 | int delete_fdt_mem_rsv(void *fdt, unsigned long start, unsigned long size)
|     ^~~~~~~~~~~~~~~~~~
>> security/integrity/ima/ima_kexec.c:115:5: warning: no previous prototype for 'ima_free_kexec_buffer' [-Wmissing-prototypes]
115 | int ima_free_kexec_buffer(void)
|     ^~~~~~~~~~~~~~~~~~~~~
>> security/integrity/ima/ima_kexec.c:144:6: warning: no previous prototype for 'remove_ima_buffer' [-Wmissing-prototypes]
144 | void remove_ima_buffer(void *fdt, int chosen_node)
|      ^~~~~~~~~~~~~~~~~
security/integrity/ima/ima_kexec.c:231:6: warning: no previous prototype for 'ima_add_kexec_buffer' [-Wmissing-prototypes]
231 | void ima_add_kexec_buffer(struct kimage *image)
|      ^~~~~~~~~~~~~~~~~~~~

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

    51	
    52	/**
    53	 * ima_get_kexec_buffer - get IMA buffer from the previous kernel
    54	 * @addr:	On successful return, set to point to the buffer contents.
    55	 * @size:	On successful return, set to the buffer size.
    56	 *
    57	 * Return: 0 on success, negative errno on error.
    58	 */
  > 59	int ima_get_kexec_buffer(void **addr, size_t *size)
    60	{
    61		int ret, len;
    62		unsigned long tmp_addr;
    63		size_t tmp_size;
    64		const void *prop;
    65	
    66		prop = of_get_property(of_chosen, "linux,ima-kexec-buffer", &len);
    67		if (!prop)
    68			return -ENOENT;
    69	
    70		ret = do_get_kexec_buffer(prop, len, &tmp_addr, &tmp_size);
    71		if (ret)
    72			return ret;
    73	
    74		*addr = __va(tmp_addr);
    75		*size = tmp_size;
    76	
    77		return 0;
    78	}
    79	
    80	/**
    81	 * delete_fdt_mem_rsv - delete memory reservation with given address and size
    82	 *
    83	 * Return: 0 on success, or negative errno on error.
    84	 */
  > 85	int delete_fdt_mem_rsv(void *fdt, unsigned long start, unsigned long size)
    86	{
    87		int i, ret, num_rsvs = fdt_num_mem_rsv(fdt);
    88	
    89		for (i = 0; i < num_rsvs; i++) {
    90			uint64_t rsv_start, rsv_size;
    91	
    92			ret = fdt_get_mem_rsv(fdt, i, &rsv_start, &rsv_size);
    93			if (ret) {
    94				pr_err("Malformed device tree.\n");
    95				return -EINVAL;
    96			}
    97	
    98			if (rsv_start == start && rsv_size == size) {
    99				ret = fdt_del_mem_rsv(fdt, i);
   100				if (ret) {
   101					pr_err("Error deleting device tree reservation.\n");
   102					return -EINVAL;
   103				}
   104	
   105				return 0;
   106			}
   107		}
   108	
   109		return -ENOENT;
   110	}
   111	
   112	/**
   113	 * ima_free_kexec_buffer - free memory used by the IMA buffer
   114	 */
 > 115	int ima_free_kexec_buffer(void)
   116	{
   117		int ret;
   118		unsigned long addr;
   119		size_t size;
   120		struct property *prop;
   121	
   122		prop = of_find_property(of_chosen, "linux,ima-kexec-buffer", NULL);
   123		if (!prop)
   124			return -ENOENT;
   125	
   126		ret = do_get_kexec_buffer(prop->value, prop->length, &addr, &size);
   127		if (ret)
   128			return ret;
   129	
   130		ret = of_remove_property(of_chosen, prop);
   131		if (ret)
   132			return ret;
   133	
   134		return memblock_free(addr, size);
   135	
   136	}
   137	
   138	/**
   139	 * remove_ima_buffer - remove the IMA buffer property and reservation from @fdt
   140	 *
   141	 * The IMA measurement buffer is of no use to a subsequent kernel, so we always
   142	 * remove it from the device tree.
   143	 */
 > 144	void remove_ima_buffer(void *fdt, int chosen_node)
   145	{
   146		int ret, len;
   147		unsigned long addr;
   148		size_t size;
   149		const void *prop;
   150	
   151		prop = fdt_getprop(fdt, chosen_node, "linux,ima-kexec-buffer", &len);
   152		if (!prop)
   153			return;
   154	
   155		ret = do_get_kexec_buffer(prop, len, &addr, &size);
   156		fdt_delprop(fdt, chosen_node, "linux,ima-kexec-buffer");
   157		if (ret)
   158			return;
   159	
   160		ret = delete_fdt_mem_rsv(fdt, addr, size);
   161		if (!ret)
   162			pr_debug("Removed old IMA buffer reservation.\n");
   163	}
   164	

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

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

  parent reply	other threads:[~2020-06-08  2:31 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-07 23:33 [v1 PATCH 0/2] Adding support to carry IMA measurement logs Prakhar Srivastava
2020-06-07 23:33 ` [v1 PATCH 1/2] Refactoring carrying over IMA measuremnet logs over Kexec Prakhar Srivastava
2020-06-08  1:35   ` kernel test robot
2020-06-08  1:47   ` kernel test robot
2020-06-08  2:29   ` kernel test robot [this message]
2020-06-08 12:02   ` Mimi Zohar
2020-06-07 23:33 ` [v1 PATCH 2/2] Add Documentation regarding the ima-kexec-buffer node in the chosen node documentation Prakhar Srivastava
2020-06-17 20:43   ` Rob Herring

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=202006081015.aeZcpHB7%lkp@intel.com \
    --to=lkp@intel.com \
    --cc=bhsharma@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kbuild-all@lists.01.org \
    --cc=kstewart@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mark.rutland@arm.com \
    --cc=prsriva@linux.microsoft.com \
    /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