From: Dan Carpenter <dan.carpenter@oracle.com>
To: bart.vanassche@wdc.com
Cc: linux-block@vger.kernel.org
Subject: [bug report] skd: Avoid that module unloading triggers a use-after-free
Date: Thu, 24 Aug 2017 14:04:12 +0300 [thread overview]
Message-ID: <20170824110412.uh27qkhutnrid7ji@mwanda> (raw)
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
next reply other threads:[~2017-08-24 11:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-24 11:04 Dan Carpenter [this message]
2017-08-24 15:04 ` [bug report] skd: Avoid that module unloading triggers a use-after-free Bart Van Assche
2017-08-24 18:36 ` Dan Carpenter
2017-08-25 20:23 ` Bart Van Assche
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170824110412.uh27qkhutnrid7ji@mwanda \
--to=dan.carpenter@oracle.com \
--cc=bart.vanassche@wdc.com \
--cc=linux-block@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox