[bug report] skd: Avoid that module unloading triggers a use-after-free

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Bart Van Assche,

This is a semi-automatic email about new static checker warnings.

The patch 7277cc67b391: "skd: Avoid that module unloading triggers a 
use-after-free" from Aug 17, 2017, leads to the following Smatch 
complaint:

drivers/block/skd_main.c:3080 skd_free_disk()
	 error: we previously assumed 'disk' could be null (see line 3074)

drivers/block/skd_main.c
  3073	
  3074		if (disk && (disk->flags & GENHD_FL_UP))
                    ^^^^
Existing code checked for NULL.  The new code shuffles things around.

  3075			del_gendisk(disk);
  3076	
  3077		if (skdev->queue) {
  3078			blk_cleanup_queue(skdev->queue);
  3079			skdev->queue = NULL;
  3080			disk->queue = NULL;
                        ^^^^^^^^^^^
Now we don't check here.

  3081		}
  3082	

regards,
dan carpenter



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux