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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 28 Jan 2023 19:52:54 +0800
From:   kernel test robot <lkp@...el.com>
To:     Nicolin Chen <nicolinc@...dia.com>, jgg@...dia.com,
        kevin.tian@...el.com
Cc:     llvm@...ts.linux.dev, oe-kbuild-all@...ts.linux.dev,
        yi.l.liu@...el.com, iommu@...ts.linux.dev,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/3] iommufd/device: Make hwpt_list list_add/del symmetric

Hi Nicolin,

I love your patch! Perhaps something to improve:

[auto build test WARNING on v6.2-rc5]
[also build test WARNING on linus/master next-20230127]
[cannot apply to joro-iommu/next]
[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#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Nicolin-Chen/iommufd-Add-devices_users-to-track-the-hw_pagetable-usage-by-device/20230128-150429
patch link:    https://lore.kernel.org/r/25b3b85b03fc2a7968c476b0533f451acecdfd13.1674872884.git.nicolinc%40nvidia.com
patch subject: [PATCH 2/3] iommufd/device: Make hwpt_list list_add/del symmetric
config: x86_64-randconfig-a011-20230123 (https://download.01.org/0day-ci/archive/20230128/202301281943.Jdvwci2p-lkp@intel.com/config)
compiler: clang version 14.0.6 (https://github.com/llvm/llvm-project f28c006a5895fc0e329fe15fead81e37457cb1d1)
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://github.com/intel-lab-lkp/linux/commit/4d48fdd86375f6d888bbcf830a10c48720008955
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Nicolin-Chen/iommufd-Add-devices_users-to-track-the-hw_pagetable-usage-by-device/20230128-150429
        git checkout 4d48fdd86375f6d888bbcf830a10c48720008955
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 olddefconfig
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=x86_64 SHELL=/bin/bash drivers/iommu/iommufd/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@...el.com>

All warnings (new ones prefixed by >>):

>> drivers/iommu/iommufd/device.c:279:23: warning: variable 'hwpt' is uninitialized when used here [-Wuninitialized]
           lockdep_assert_held(&hwpt->ioas->mutex);
                                ^~~~
   include/linux/lockdep.h:319:33: note: expanded from macro 'lockdep_assert_held'
           lockdep_assert(lockdep_is_held(l) != LOCK_STATE_NOT_HELD)
                                          ^
   include/linux/lockdep.h:286:47: note: expanded from macro 'lockdep_is_held'
   #define lockdep_is_held(lock)           lock_is_held(&(lock)->dep_map)
                                                          ^~~~
   include/linux/lockdep.h:313:32: note: expanded from macro 'lockdep_assert'
           do { WARN_ON(debug_locks && !(cond)); } while (0)
                                         ^~~~
   include/asm-generic/bug.h:122:25: note: expanded from macro 'WARN_ON'
           int __ret_warn_on = !!(condition);                              \
                                  ^~~~~~~~~
   drivers/iommu/iommufd/device.c:276:35: note: initialize the variable 'hwpt' to silence this warning
           struct iommufd_hw_pagetable *hwpt;
                                            ^
                                             = NULL
   1 warning generated.


vim +/hwpt +279 drivers/iommu/iommufd/device.c

   267	
   268	/*
   269	 * When automatically managing the domains we search for a compatible domain in
   270	 * the iopt and if one is found use it, otherwise create a new domain.
   271	 * Automatic domain selection will never pick a manually created domain.
   272	 */
   273	static int iommufd_device_auto_get_domain(struct iommufd_device *idev,
   274						  struct iommufd_ioas *ioas)
   275	{
   276		struct iommufd_hw_pagetable *hwpt;
   277		int rc;
   278	
 > 279		lockdep_assert_held(&hwpt->ioas->mutex);
   280	
   281		/*
   282		 * There is no differentiation when domains are allocated, so any domain
   283		 * that is willing to attach to the device is interchangeable with any
   284		 * other.
   285		 */
   286		list_for_each_entry(hwpt, &ioas->hwpt_list, hwpt_item) {
   287			if (!hwpt->auto_domain)
   288				continue;
   289	
   290			rc = iommufd_device_do_attach(idev, hwpt);
   291	
   292			/*
   293			 * -EINVAL means the domain is incompatible with the device.
   294			 * Other error codes should propagate to userspace as failure.
   295			 * Success means the domain is attached.
   296			 */
   297			if (rc == -EINVAL)
   298				continue;
   299			return rc;
   300		}
   301	
   302		hwpt = iommufd_hw_pagetable_alloc(idev->ictx, ioas, idev->dev);
   303		if (IS_ERR(hwpt))
   304			return PTR_ERR(hwpt);
   305		hwpt->auto_domain = true;
   306	
   307		rc = iommufd_device_do_attach(idev, hwpt);
   308		if (rc)
   309			goto out_abort;
   310	
   311		iommufd_object_finalize(idev->ictx, &hwpt->obj);
   312		return 0;
   313	
   314	out_abort:
   315		iommufd_object_abort_and_destroy(idev->ictx, &hwpt->obj);
   316		return rc;
   317	}
   318	

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ