All of lore.kernel.org
 help / color / mirror / Atom feed
* [jarkko-tpmdd:hibernate 32/39] drivers/char/tpm/tpm2-rsp.h:112 tpm2_rsp_ecdsa_public() warn: was && intended here instead of ||?
@ 2026-11-10  7:47 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-11-10  7:47 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

Unfiltered warning: this smatch report is sent as-is and has not been
reviewed for false positives, so please treat it with due skepticism.

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Jarkko Sakkinen <jarkko@kernel.org>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/jarkko/linux-tpmdd.git hibernate
head:   74bb07bc3885849d08ac7ab1942479559faa986c
commit: 53d3622f5f68be4ed89dbb5d232c14b56992ab56 [32/39] tpm: Move the bounds-checked response reader to a header
:::::: branch date: 7 hours ago
:::::: commit date: 7 hours ago
config: parisc-randconfig-2200-20261110 (https://download.01.org/0day-ci/archive/20261110/202611100802.66Q7bfro-lkp@intel.com/config)
compiler: hppa-linux-gcc (GCC) 15.3.0
smatch: v0.5.0-9187-g5189e3fb

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202611100802.66Q7bfro-lkp@intel.com/

New smatch warnings:
drivers/char/tpm/tpm2-rsp.h:112 tpm2_rsp_ecdsa_public() warn: was && intended here instead of ||?

Old smatch warnings:
drivers/char/tpm/tpm2-ak.c:253 tpm2_get_signed_audit_digest() warn: was && intended here instead of ||?

vim +112 drivers/char/tpm/tpm2-rsp.h

53d3622f5f68be Matthew Garrett 2026-10-08  100  
53d3622f5f68be Matthew Garrett 2026-10-08  101  /*
53d3622f5f68be Matthew Garrett 2026-10-08  102   * Parse a TPM2B_PUBLIC for an ECDSA-SHA256 P-256 signing key with no
53d3622f5f68be Matthew Garrett 2026-10-08  103   * symmetric algorithm, KDF or policy, checking that it has exactly the
53d3622f5f68be Matthew Garrett 2026-10-08  104   * object attributes @attrs, and return its public point.
53d3622f5f68be Matthew Garrett 2026-10-08  105   */
53d3622f5f68be Matthew Garrett 2026-10-08  106  static inline int tpm2_rsp_ecdsa_public(struct tpm2_rsp *r, u32 attrs,
53d3622f5f68be Matthew Garrett 2026-10-08  107  					u8 *x, u8 *y)
53d3622f5f68be Matthew Garrett 2026-10-08  108  {
53d3622f5f68be Matthew Garrett 2026-10-08  109  	u16 size = tpm2_rsp_u16(r);
53d3622f5f68be Matthew Garrett 2026-10-08  110  	u32 end = r->off + size;
53d3622f5f68be Matthew Garrett 2026-10-08  111  
53d3622f5f68be Matthew Garrett 2026-10-08 @112  	if (tpm2_rsp_u16(r) != TPM_ALG_ECC ||
53d3622f5f68be Matthew Garrett 2026-10-08  113  	    tpm2_rsp_u16(r) != TPM_ALG_SHA256 ||
53d3622f5f68be Matthew Garrett 2026-10-08  114  	    tpm2_rsp_u32(r) != attrs ||
53d3622f5f68be Matthew Garrett 2026-10-08  115  	    tpm2_rsp_u16(r) != 0 ||			/* authPolicy */
53d3622f5f68be Matthew Garrett 2026-10-08  116  	    tpm2_rsp_u16(r) != TPM_ALG_NULL ||		/* symmetric */
53d3622f5f68be Matthew Garrett 2026-10-08  117  	    tpm2_rsp_u16(r) != TPM_ALG_ECDSA ||		/* scheme */
53d3622f5f68be Matthew Garrett 2026-10-08  118  	    tpm2_rsp_u16(r) != TPM_ALG_SHA256 ||	/* scheme hash */
53d3622f5f68be Matthew Garrett 2026-10-08  119  	    tpm2_rsp_u16(r) != TPM2_ECC_NIST_P256 ||
53d3622f5f68be Matthew Garrett 2026-10-08  120  	    tpm2_rsp_u16(r) != TPM_ALG_NULL)		/* kdf */
53d3622f5f68be Matthew Garrett 2026-10-08  121  		return -EINVAL;
53d3622f5f68be Matthew Garrett 2026-10-08  122  
53d3622f5f68be Matthew Garrett 2026-10-08  123  	tpm2_rsp_ecc_param(r, x);
53d3622f5f68be Matthew Garrett 2026-10-08  124  	tpm2_rsp_ecc_param(r, y);
53d3622f5f68be Matthew Garrett 2026-10-08  125  
53d3622f5f68be Matthew Garrett 2026-10-08  126  	if (r->err || r->off != end)
53d3622f5f68be Matthew Garrett 2026-10-08  127  		return -EINVAL;
53d3622f5f68be Matthew Garrett 2026-10-08  128  
53d3622f5f68be Matthew Garrett 2026-10-08  129  	return 0;
53d3622f5f68be Matthew Garrett 2026-10-08  130  }
53d3622f5f68be Matthew Garrett 2026-10-08  131  

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-10  7:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-10  7:47 [jarkko-tpmdd:hibernate 32/39] drivers/char/tpm/tpm2-rsp.h:112 tpm2_rsp_ecdsa_public() warn: was && intended here instead of ||? kernel test robot

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.