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]
Message-ID: <202211291958.Y9yORRNq-lkp@intel.com>
Date:   Tue, 29 Nov 2022 19:23:48 +0800
From:   kernel test robot <lkp@...el.com>
To:     Li Nan <linan122@...wei.com>, tj@...nel.org, josef@...icpanda.com,
        axboe@...nel.dk
Cc:     oe-kbuild-all@...ts.linux.dev, cgroups@...r.kernel.org,
        linux-block@...r.kernel.org, linux-kernel@...r.kernel.org,
        linan122@...wei.com, yukuai3@...wei.com, yi.zhang@...wei.com
Subject: Re: [PATCH -next 8/8] block: fix null-pointer dereference in
 ioc_pd_init

Hi Li,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on next-20221128]

url:    https://github.com/intel-lab-lkp/linux/commits/Li-Nan/iocost-bugfix/20221128-232536
patch link:    https://lore.kernel.org/r/20221128154434.4177442-9-linan122%40huawei.com
patch subject: [PATCH -next 8/8] block: fix null-pointer dereference in ioc_pd_init
config: arm-randconfig-r046-20221128
compiler: arm-linux-gnueabi-gcc (GCC) 12.1.0
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/44da423d235b6c23ecf6a38325d0429cfac20ee2
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Li-Nan/iocost-bugfix/20221128-232536
        git checkout 44da423d235b6c23ecf6a38325d0429cfac20ee2
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

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

All errors (new ones prefixed by >>):

   block/genhd.c: In function 'disk_release':
>> block/genhd.c:1170:21: error: 'q' undeclared (first use in this function); did you mean 'rq'?
    1170 |         rq_qos_exit(q);
         |                     ^
         |                     rq
   block/genhd.c:1170:21: note: each undeclared identifier is reported only once for each function it appears in


vim +1170 block/genhd.c

  1136	
  1137	/**
  1138	 * disk_release - releases all allocated resources of the gendisk
  1139	 * @dev: the device representing this disk
  1140	 *
  1141	 * This function releases all allocated resources of the gendisk.
  1142	 *
  1143	 * Drivers which used __device_add_disk() have a gendisk with a request_queue
  1144	 * assigned. Since the request_queue sits on top of the gendisk for these
  1145	 * drivers we also call blk_put_queue() for them, and we expect the
  1146	 * request_queue refcount to reach 0 at this point, and so the request_queue
  1147	 * will also be freed prior to the disk.
  1148	 *
  1149	 * Context: can sleep
  1150	 */
  1151	static void disk_release(struct device *dev)
  1152	{
  1153		struct gendisk *disk = dev_to_disk(dev);
  1154	
  1155		might_sleep();
  1156		WARN_ON_ONCE(disk_live(disk));
  1157	
  1158		/*
  1159		 * To undo the all initialization from blk_mq_init_allocated_queue in
  1160		 * case of a probe failure where add_disk is never called we have to
  1161		 * call blk_mq_exit_queue here. We can't do this for the more common
  1162		 * teardown case (yet) as the tagset can be gone by the time the disk
  1163		 * is released once it was added.
  1164		 */
  1165		if (queue_is_mq(disk->queue) &&
  1166		    test_bit(GD_OWNS_QUEUE, &disk->state) &&
  1167		    !test_bit(GD_ADDED, &disk->state))
  1168			blk_mq_exit_queue(disk->queue);
  1169	
> 1170		rq_qos_exit(q);
  1171		blkcg_exit_disk(disk);
  1172	
  1173		bioset_exit(&disk->bio_split);
  1174	
  1175		disk_release_events(disk);
  1176		kfree(disk->random);
  1177		disk_free_zone_bitmaps(disk);
  1178		xa_destroy(&disk->part_tbl);
  1179	
  1180		disk->queue->disk = NULL;
  1181		blk_put_queue(disk->queue);
  1182	
  1183		if (test_bit(GD_ADDED, &disk->state) && disk->fops->free_disk)
  1184			disk->fops->free_disk(disk);
  1185	
  1186		iput(disk->part0->bd_inode);	/* frees the disk */
  1187	}
  1188	

-- 
0-DAY CI Kernel Test Service
https://01.org/lkp

View attachment "config" of type "text/plain" (175490 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ