From: Dan Carpenter <dan.carpenter@oracle.com>
To: Ming Lei <ming.lei@redhat.com>
Cc: linux-block@vger.kernel.org
Subject: Re: [bug report] block: avoid use-after-free on throttle data
Date: Tue, 22 Mar 2022 18:25:06 +0300 [thread overview]
Message-ID: <20220322152506.GY336@kadam> (raw)
In-Reply-To: <Yjl95JV5yANdC/QK@T590>
On Tue, Mar 22, 2022 at 03:42:28PM +0800, Ming Lei wrote:
> > 1187 if (parent_sq) {
> > 1188 /* @parent_sq is another throl_grp, propagate dispatch */
> > 1189 if (tg->flags & THROTL_TG_WAS_EMPTY) {
> > ^^^^^^^^^
> > But the old code dereferences "tg" without checking.
>
> Here if 'parent_sq' isn't NULL, tg won't be NULL, see sq_to_tg()
>
Thanks. It would have taken me a while to find sq_to_tg(). Smatch is
supposed to figure out this stuff but somehow it's not working.
Smatch knows that if "tg" is non-NULL then parent_sq is non-NULL. And
it knows that if sq->parent_sq is NULL then tg is NULL. But somehow it
can't figure out that if sq->parent_sq is non-NULL then tg is non-NULL...
:/
Something to investigate but I ran out of time today.
regards,
dan carpenter
prev parent reply other threads:[~2022-03-22 15:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-22 6:55 [bug report] block: avoid use-after-free on throttle data Dan Carpenter
2022-03-22 7:42 ` Ming Lei
2022-03-22 15:25 ` Dan Carpenter [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=20220322152506.GY336@kadam \
--to=dan.carpenter@oracle.com \
--cc=linux-block@vger.kernel.org \
--cc=ming.lei@redhat.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.