Linux block layer
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@fb.com>
To: Joseph Qi <jiangqi903@gmail.com>, linux-block@vger.kernel.org
Cc: Shaohua Li <shli@fb.com>,
	boyu.mt@taobao.com, wenqing.lz@taobao.com,
	qijiang.qj@alibaba-inc.com
Subject: Re: [PATCH] blk-throttle: fix NULL pointer dereference in throtl_schedule_pending_timer
Date: Wed, 7 Jun 2017 08:12:05 -0600	[thread overview]
Message-ID: <3bb46db6-4395-194d-84ab-334a2eb4f99f@fb.com> (raw)
In-Reply-To: <ba25ffe3-9db7-2311-51c7-91fce0ce8cfa@gmail.com>

On 06/06/2017 09:36 PM, Joseph Qi wrote:
> From: Joseph Qi <qijiang.qj@alibaba-inc.com>
> 
> I have encountered a NULL pointer dereference in
> throtl_schedule_pending_timer:
>   [  413.735396] BUG: unable to handle kernel NULL pointer dereference at 0000000000000038
>   [  413.735535] IP: [<ffffffff812ebbbf>] throtl_schedule_pending_timer+0x3f/0x210
>   [  413.735643] PGD 22c8cf067 PUD 22cb34067 PMD 0
>   [  413.735713] Oops: 0000 [#1] SMP
>   ......
> 
> This is caused by the following case:
>   blk_throtl_bio
>     throtl_schedule_next_dispatch  <= sq is top level one without parent
>       throtl_schedule_pending_timer
>         sq_to_tg(sq)->td->throtl_slice  <= sq_to_tg(sq) returns NULL
> 
> Fix it by using sq_to_td instead of sq_to_tg(sq)->td, which will always
> return a valid td.

Applied, thanks.

-- 
Jens Axboe

      parent reply	other threads:[~2017-06-07 14:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-07  3:36 [PATCH] blk-throttle: fix NULL pointer dereference in throtl_schedule_pending_timer Joseph Qi
2017-06-07  4:24 ` Shaohua Li
2017-06-07 14:12 ` Jens Axboe [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=3bb46db6-4395-194d-84ab-334a2eb4f99f@fb.com \
    --to=axboe@fb.com \
    --cc=boyu.mt@taobao.com \
    --cc=jiangqi903@gmail.com \
    --cc=linux-block@vger.kernel.org \
    --cc=qijiang.qj@alibaba-inc.com \
    --cc=shli@fb.com \
    --cc=wenqing.lz@taobao.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox