Re: [PATCH 2/3] KEYS: trusted: Reserve TPM for seal and unseal operations

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

 



Hi Jarkko,

I love your patch! Perhaps something to improve:

[auto build test WARNING on security/next-testing]
[also build test WARNING on integrity/next-integrity char-misc/char-misc-testing linus/master v5.9-rc8 next-20201002]
[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/Jarkko-Sakkinen/KEYS-trusted-Fix-incorrect-handling-of-tpm_get_random/20201005-092710
base:   https://git.kernel.org/pub/scm/linux/kernel/git/jmorris/linux-security.git next-testing
config: x86_64-randconfig-s022-20201005 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-201-g24bdaac6-dirty
        # https://github.com/0day-ci/linux/commit/ef36c0cd07555d658f81aee66abb02bdbe1c37b7
        git remote add linux-review https://github.com/0day-ci/linux
        git fetch --no-tags linux-review Jarkko-Sakkinen/KEYS-trusted-Fix-incorrect-handling-of-tpm_get_random/20201005-092710
        git checkout ef36c0cd07555d658f81aee66abb02bdbe1c37b7
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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

	echo
	echo "sparse warnings: (new ones prefixed by >>)"
	echo
   security/keys/encrypted-keys/encrypted.c: note: in included file (through include/keys/trusted-type.h):
>> include/linux/tpm.h:423:16: sparse: sparse: function 'tpm_transmit_cmd' with external linkage has definition
   include/linux/tpm.h:423:16: sparse: sparse: symbol 'tpm_transmit_cmd' was not declared. Should it be static?

vim +/tpm_transmit_cmd +423 include/linux/tpm.h

   397	
   398	extern int tpm_is_tpm2(struct tpm_chip *chip);
   399	extern __must_check int tpm_try_get_ops(struct tpm_chip *chip);
   400	extern void tpm_put_ops(struct tpm_chip *chip);
   401	extern ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_buf *buf,
   402					size_t min_rsp_body_length, const char *desc);
   403	extern int tpm_pcr_read(struct tpm_chip *chip, u32 pcr_idx,
   404				struct tpm_digest *digest);
   405	extern int tpm_pcr_extend(struct tpm_chip *chip, u32 pcr_idx,
   406				  struct tpm_digest *digests);
   407	extern int tpm_send(struct tpm_chip *chip, void *cmd, size_t buflen);
   408	extern int tpm_get_random(struct tpm_chip *chip, u8 *data, size_t max);
   409	extern struct tpm_chip *tpm_default_chip(void);
   410	void tpm2_flush_context(struct tpm_chip *chip, u32 handle);
   411	#else
   412	static inline int tpm_is_tpm2(struct tpm_chip *chip)
   413	{
   414		return -ENODEV;
   415	}
   416	static inline int tpm_try_get_ops(struct tpm_chip *chip)
   417	{
   418		return -ENODEV;
   419	}
   420	static inline void tpm_put_ops(struct tpm_chip *chip)
   421	{
   422	}
 > 423	extern ssize_t tpm_transmit_cmd(struct tpm_chip *chip, struct tpm_buf *buf,
   424					size_t min_rsp_body_length, const char *desc)
   425	{
   426	}
   427	static inline int tpm_pcr_read(struct tpm_chip *chip, int pcr_idx,
   428				       struct tpm_digest *digest)
   429	{
   430		return -ENODEV;
   431	}
   432	

---
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]     [Linux Kernel]     [Kernel Development Newbies]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Hiking]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux