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: <202601132340.SXTnCe4J-lkp@intel.com>
Date: Tue, 13 Jan 2026 23:20:53 +0800
From: kernel test robot <lkp@...el.com>
To: Yu Kuai <yukuai3@...wei.com>
Cc: oe-kbuild-all@...ts.linux.dev, linux-kernel@...r.kernel.org,
 Song Liu <song@...nel.org>
Subject: drivers/md/md-linear.c:216:19: sparse: sparse: incompatible
 types in comparison expression (different address spaces):

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b71e635feefc852405b14620a7fc58c4c80c0f73
commit: 127186cfb184eaccdfe948e6da66940cfa03efc5 md: reintroduce md-linear
date:   1 year ago
config: sparc64-randconfig-r134-20260113 (https://download.01.org/0day-ci/archive/20260113/202601132340.SXTnCe4J-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 9b8addffa70cee5b2acc5454712d9cf78ce45710)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/202601132340.SXTnCe4J-lkp@intel.com/reproduce)

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/202601132340.SXTnCe4J-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/md/md-linear.c:216:19: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/md/md-linear.c:216:19: sparse:    void [noderef] __rcu *
   drivers/md/md-linear.c:216:19: sparse:    void *
   drivers/md/md-linear.c:221:9: sparse: sparse: incompatible types in comparison expression (different address spaces):
   drivers/md/md-linear.c:221:9: sparse:    void [noderef] __rcu *
   drivers/md/md-linear.c:221:9: sparse:    void *

vim +216 drivers/md/md-linear.c

   187	
   188	static int linear_add(struct mddev *mddev, struct md_rdev *rdev)
   189	{
   190		/* Adding a drive to a linear array allows the array to grow.
   191		 * It is permitted if the new drive has a matching superblock
   192		 * already on it, with raid_disk equal to raid_disks.
   193		 * It is achieved by creating a new linear_private_data structure
   194		 * and swapping it in in-place of the current one.
   195		 * The current one is never freed until the array is stopped.
   196		 * This avoids races.
   197		 */
   198		struct linear_conf *newconf, *oldconf;
   199	
   200		if (rdev->saved_raid_disk != mddev->raid_disks)
   201			return -EINVAL;
   202	
   203		rdev->raid_disk = rdev->saved_raid_disk;
   204		rdev->saved_raid_disk = -1;
   205	
   206		newconf = linear_conf(mddev, mddev->raid_disks + 1);
   207		if (!newconf)
   208			return -ENOMEM;
   209	
   210		/* newconf->raid_disks already keeps a copy of * the increased
   211		 * value of mddev->raid_disks, WARN_ONCE() is just used to make
   212		 * sure of this. It is possible that oldconf is still referenced
   213		 * in linear_congested(), therefore kfree_rcu() is used to free
   214		 * oldconf until no one uses it anymore.
   215		 */
 > 216		oldconf = rcu_dereference_protected(mddev->private,
   217				lockdep_is_held(&mddev->reconfig_mutex));
   218		mddev->raid_disks++;
   219		WARN_ONCE(mddev->raid_disks != newconf->raid_disks,
   220			"copied raid_disks doesn't match mddev->raid_disks");
   221		rcu_assign_pointer(mddev->private, newconf);
   222		md_set_array_sectors(mddev, linear_size(mddev, 0, 0));
   223		set_capacity_and_notify(mddev->gendisk, mddev->array_sectors);
   224		kfree_rcu(oldconf, rcu);
   225		return 0;
   226	}
   227	

-- 
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