From: Tejun Heo <tj@kernel.org>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: linux-ide@vger.kernel.org, kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] libata: array underflow in ata_find_dev()
Date: Wed, 19 Jul 2017 10:34:08 -0400 [thread overview]
Message-ID: <20170719143407.GK3365493@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <20170719100641.7ste3wo6ap2g2djv@mwanda>
Hello,
On Wed, Jul 19, 2017 at 01:06:41PM +0300, Dan Carpenter wrote:
> My static checker complains that "devno" can be negative, meaning that
> we read before the start of the loop. I've looked at the code, and I
> think the warning is right. This come from /proc so it's root only or
> it would be quite a quite a serious bug. The call tree looks like this:
>
> proc_scsi_write() <- gets id and channel from simple_strtoul()
> -> scsi_add_single_device() <- calls shost->transportt->user_scan()
> -> ata_scsi_user_scan()
> -> ata_find_dev()
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
I'm impressed that the static checker caught this. Thanks a lot for
the fix, and lol at the code. :) Applied to libata/for-4.13-fixes w/
stable cc'd.
Thanks!
--
tejun
prev parent reply other threads:[~2017-07-19 14:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-07-19 10:06 [PATCH] libata: array underflow in ata_find_dev() Dan Carpenter
2017-07-19 14:34 ` Tejun Heo [this message]
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=20170719143407.GK3365493@devbig577.frc2.facebook.com \
--to=tj@kernel.org \
--cc=dan.carpenter@oracle.com \
--cc=kernel-janitors@vger.kernel.org \
--cc=linux-ide@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