lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202512190044.RICLFTSA-lkp@intel.com>
Date: Fri, 19 Dec 2025 00:54:57 +0800
From: kernel test robot <lkp@...el.com>
To: Stuart Yoder <stuart.yoder@....com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
	Jarkko Sakkinen <jarkko@...nel.org>
Subject: drivers/char/tpm/tpm_crb_ffa.c:311 tpm_crb_ffa_probe() warn:
 unsigned 'tpm_crb_ffa->minor_version' is never less than zero.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ea1013c1539270e372fc99854bc6e4d94eaeff66
commit: eb93f0734ef1bc5657313bfb55cda58763363603 tpm_crb: ffa_tpm: Implement driver compliant to CRB over FF-A
date:   9 months ago
config: arm64-randconfig-r072-20251218 (https://download.01.org/0day-ci/archive/20251219/202512190044.RICLFTSA-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 9.5.0

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@...el.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202512190044.RICLFTSA-lkp@intel.com/

smatch warnings:
drivers/char/tpm/tpm_crb_ffa.c:311 tpm_crb_ffa_probe() warn: unsigned 'tpm_crb_ffa->minor_version' is never less than zero.

vim +311 drivers/char/tpm/tpm_crb_ffa.c

   268	
   269	static int tpm_crb_ffa_probe(struct ffa_device *ffa_dev)
   270	{
   271		struct tpm_crb_ffa *p;
   272		int rc;
   273	
   274		/* only one instance of a TPM partition is supported */
   275		if (tpm_crb_ffa && !IS_ERR_VALUE(tpm_crb_ffa))
   276			return -EEXIST;
   277	
   278		tpm_crb_ffa = ERR_PTR(-ENODEV); // set tpm_crb_ffa so we can detect probe failure
   279	
   280		if (!ffa_partition_supports_direct_recv(ffa_dev)) {
   281			pr_err("TPM partition doesn't support direct message receive.\n");
   282			return -EINVAL;
   283		}
   284	
   285		p = kzalloc(sizeof(*tpm_crb_ffa), GFP_KERNEL);
   286		if (!p)
   287			return -ENOMEM;
   288		tpm_crb_ffa = p;
   289	
   290		mutex_init(&tpm_crb_ffa->msg_data_lock);
   291		tpm_crb_ffa->ffa_dev = ffa_dev;
   292		ffa_dev_set_drvdata(ffa_dev, tpm_crb_ffa);
   293	
   294		/* if TPM is aarch32 use 32-bit SMCs */
   295		if (!ffa_partition_check_property(ffa_dev, FFA_PARTITION_AARCH64_EXEC))
   296			ffa_dev->ops->msg_ops->mode_32bit_set(ffa_dev);
   297	
   298		/* verify compatibility of TPM service version number */
   299		rc = tpm_crb_ffa_get_interface_version(&tpm_crb_ffa->major_version,
   300						       &tpm_crb_ffa->minor_version);
   301		if (rc) {
   302			pr_err("failed to get crb interface version. rc:%d", rc);
   303			goto out;
   304		}
   305	
   306		pr_info("ABI version %u.%u", tpm_crb_ffa->major_version,
   307			tpm_crb_ffa->minor_version);
   308	
   309		if (tpm_crb_ffa->major_version != CRB_FFA_VERSION_MAJOR ||
   310		    (tpm_crb_ffa->minor_version > 0 &&
 > 311		    tpm_crb_ffa->minor_version < CRB_FFA_VERSION_MINOR)) {
   312			pr_err("Incompatible ABI version");
   313			goto out;
   314		}
   315	
   316		return 0;
   317	
   318	out:
   319		kfree(tpm_crb_ffa);
   320		tpm_crb_ffa = ERR_PTR(-ENODEV);
   321		return -EINVAL;
   322	}
   323	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ