All of lore.kernel.org
 help / color / mirror / Atom feed
* [jejb-tpmdd:tpmdd-for-next 2/2] security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2' undeclared; did you mean 'tm'?
@ 2021-04-22  2:33 kernel test robot
  2021-04-22  5:32 ` James Bottomley
  0 siblings, 1 reply; 2+ messages in thread
From: kernel test robot @ 2021-04-22  2:33 UTC (permalink / raw)
  To: kbuild-all

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git tpmdd-for-next
head:   74061d5368657b78d4488a276680450bc6e6c06e
commit: 74061d5368657b78d4488a276680450bc6e6c06e [2/2] Merge branch 'tpmdd-fixes' into tpmdd-for-next
config: m68k-allmodconfig (attached as .config)
compiler: m68k-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
        # https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git/commit/?id=74061d5368657b78d4488a276680450bc6e6c06e
        git remote add jejb-tpmdd https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git
        git fetch --no-tags jejb-tpmdd tpmdd-for-next
        git checkout 74061d5368657b78d4488a276680450bc6e6c06e
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross W=1 ARCH=m68k 

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

All errors (new ones prefixed by >>):

   security/keys/trusted-keys/trusted_tpm2.c: In function 'tpm2_seal_trusted':
>> security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2' undeclared (first use in this function); did you mean 'tm'?
     248 |  if (!options->keyhandle && !tpm2)
         |                              ^~~~
         |                              tm
   security/keys/trusted-keys/trusted_tpm2.c:248:30: note: each undeclared identifier is reported only once for each function it appears in


vim +248 security/keys/trusted-keys/trusted_tpm2.c

   217	
   218	/**
   219	 * tpm2_seal_trusted() - seal the payload of a trusted key
   220	 *
   221	 * @chip: TPM chip to use
   222	 * @payload: the key data in clear and encrypted form
   223	 * @options: authentication values and other options
   224	 *
   225	 * Return: < 0 on error and 0 on success.
   226	 */
   227	int tpm2_seal_trusted(struct tpm_chip *chip,
   228			      struct trusted_key_payload *payload,
   229			      struct trusted_key_options *options)
   230	{
   231		int blob_len = 0;
   232		struct tpm_buf buf;
   233		u32 hash;
   234		u32 flags;
   235		int i;
   236		int rc;
   237	
   238		for (i = 0; i < ARRAY_SIZE(tpm2_hash_map); i++) {
   239			if (options->hash == tpm2_hash_map[i].crypto_id) {
   240				hash = tpm2_hash_map[i].tpm_id;
   241				break;
   242			}
   243		}
   244	
   245		if (i == ARRAY_SIZE(tpm2_hash_map))
   246			return -EINVAL;
   247	
 > 248		if (!options->keyhandle && !tpm2)
   249			return -EINVAL;
   250	
   251		rc = tpm_try_get_ops(chip);
   252		if (rc)
   253			return rc;
   254	
   255		rc = tpm_buf_init(&buf, TPM2_ST_SESSIONS, TPM2_CC_CREATE);
   256		if (rc) {
   257			tpm_put_ops(chip);
   258			return rc;
   259		}
   260	
   261		tpm_buf_append_u32(&buf, options->keyhandle);
   262		tpm2_buf_append_auth(&buf, TPM2_RS_PW,
   263				     NULL /* nonce */, 0,
   264				     0 /* session_attributes */,
   265				     options->keyauth /* hmac */,
   266				     TPM_DIGEST_SIZE);
   267	
   268		/* sensitive */
   269		tpm_buf_append_u16(&buf, 4 + options->blobauth_len + payload->key_len);
   270	
   271		tpm_buf_append_u16(&buf, options->blobauth_len);
   272		if (options->blobauth_len)
   273			tpm_buf_append(&buf, options->blobauth, options->blobauth_len);
   274	
   275		tpm_buf_append_u16(&buf, payload->key_len);
   276		tpm_buf_append(&buf, payload->key, payload->key_len);
   277	
   278		/* public */
   279		tpm_buf_append_u16(&buf, 14 + options->policydigest_len);
   280		tpm_buf_append_u16(&buf, TPM_ALG_KEYEDHASH);
   281		tpm_buf_append_u16(&buf, hash);
   282	
   283		/* key properties */
   284		flags = 0;
   285		flags |= options->policydigest_len ? 0 : TPM2_OA_USER_WITH_AUTH;
   286		flags |= payload->migratable ? (TPM2_OA_FIXED_TPM |
   287						TPM2_OA_FIXED_PARENT) : 0;
   288		tpm_buf_append_u32(&buf, flags);
   289	
   290		/* policy */
   291		tpm_buf_append_u16(&buf, options->policydigest_len);
   292		if (options->policydigest_len)
   293			tpm_buf_append(&buf, options->policydigest,
   294				       options->policydigest_len);
   295	
   296		/* public parameters */
   297		tpm_buf_append_u16(&buf, TPM_ALG_NULL);
   298		tpm_buf_append_u16(&buf, 0);
   299	
   300		/* outside info */
   301		tpm_buf_append_u16(&buf, 0);
   302	
   303		/* creation PCR */
   304		tpm_buf_append_u32(&buf, 0);
   305	
   306		if (buf.flags & TPM_BUF_OVERFLOW) {
   307			rc = -E2BIG;
   308			goto out;
   309		}
   310	
   311		rc = tpm_transmit_cmd(chip, &buf, 4, "sealing data");
   312		if (rc)
   313			goto out;
   314	
   315		blob_len = be32_to_cpup((__be32 *) &buf.data[TPM_HEADER_SIZE]);
   316		if (blob_len > MAX_BLOB_SIZE) {
   317			rc = -E2BIG;
   318			goto out;
   319		}
   320		if (tpm_buf_length(&buf) < TPM_HEADER_SIZE + 4 + blob_len) {
   321			rc = -EFAULT;
   322			goto out;
   323		}
   324	
   325		blob_len = tpm2_key_encode(payload, options,
   326					   &buf.data[TPM_HEADER_SIZE + 4],
   327					   blob_len);
   328	
   329	out:
   330		tpm_buf_destroy(&buf);
   331	
   332		if (rc > 0) {
   333			if (tpm2_rc_value(rc) == TPM2_RC_HASH)
   334				rc = -EINVAL;
   335			else
   336				rc = -EPERM;
   337		}
   338		if (blob_len < 0)
   339			return blob_len;
   340	
   341		payload->blob_len = blob_len;
   342	
   343		tpm_put_ops(chip);
   344		return rc;
   345	}
   346	

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

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [jejb-tpmdd:tpmdd-for-next 2/2] security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2' undeclared; did you mean 'tm'?
  2021-04-22  2:33 [jejb-tpmdd:tpmdd-for-next 2/2] security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2' undeclared; did you mean 'tm'? kernel test robot
@ 2021-04-22  5:32 ` James Bottomley
  0 siblings, 0 replies; 2+ messages in thread
From: James Bottomley @ 2021-04-22  5:32 UTC (permalink / raw)
  To: kbuild-all

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

On Thu, 2021-04-22 at 10:33 +0800, kernel test robot wrote:
> tree:   
> https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git tpmdd-
> for-next
> head:   74061d5368657b78d4488a276680450bc6e6c06e
> commit: 74061d5368657b78d4488a276680450bc6e6c06e [2/2] Merge branch
> 'tpmdd-fixes' into tpmdd-for-next
> config: m68k-allmodconfig (attached as .config)
> compiler: m68k-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
>         # 
> https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git/commit/?id=74061d5368657b78d4488a276680450bc6e6c06e
>         git remote add jejb-tpmdd 
> https://git.kernel.org/pub/scm/linux/kernel/git/jejb/tpmdd.git
>         git fetch --no-tags jejb-tpmdd tpmdd-for-next
>         git checkout 74061d5368657b78d4488a276680450bc6e6c06e
>         # save the attached .config to linux build tree
>         COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0
> make.cross W=1 ARCH=m68k 
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>    security/keys/trusted-keys/trusted_tpm2.c: In function
> 'tpm2_seal_trusted':
> > > security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2'
> > > undeclared (first use in this function); did you mean 'tm'?
>      248 |  if (!options->keyhandle && !tpm2)
>          |                              ^~~~
>          |                              tm
>    security/keys/trusted-keys/trusted_tpm2.c:248:30: note: each
> undeclared identifier is reported only once for each function it
> appears in
> 

This was a simple mismerge.  I redid the merge to fix it.

James


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-04-22  5:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-22  2:33 [jejb-tpmdd:tpmdd-for-next 2/2] security/keys/trusted-keys/trusted_tpm2.c:248:30: error: 'tpm2' undeclared; did you mean 'tm'? kernel test robot
2021-04-22  5:32 ` James Bottomley

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.