From: Omar Sandoval <osandov@osandov.com>
To: linux-block@vger.kernel.org
Cc: Jens Axboe <axboe@fb.com>,
kernel-team@fb.com,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
Dmitry Vyukov <dvyukov@google.com>
Subject: Re: [PATCH] loop: fix LOOP_GET_STATUS lock imbalance
Date: Fri, 6 Apr 2018 10:01:42 -0700 [thread overview]
Message-ID: <20180406170142.GB11697@vader> (raw)
In-Reply-To: <6bee3eddc24ef5525ca12efb023e66b2503cb178.1523033157.git.osandov@fb.com>
On Fri, Apr 06, 2018 at 09:57:03AM -0700, Omar Sandoval wrote:
> From: Omar Sandoval <osandov@fb.com>
>
> Commit 2d1d4c1e591f made loop_get_status() drop lo_ctx_mutex before
> returning, but the loop_get_status_old(), loop_get_status64(), and
> loop_get_status_compat() wrappers don't call loop_get_status() if the
> passed argument is NULL. The callers expect that the lock is dropped, so
> make sure we drop it in that case, too.
>
> Reported-by: syzbot+31e8daa8b3fc129e75f2@syzkaller.appspotmail.com
> Fixes: 2d1d4c1e591f ("loop: don't call into filesystem while holding lo_ctl_mutex")
> Signed-off-by: Omar Sandoval <osandov@fb.com>
> ---
> Based on Linus' tree.
>
> drivers/block/loop.c | 33 ++++++++++++++++++---------------
> 1 file changed, 18 insertions(+), 15 deletions(-)
Also just pushed a regression test to blktests:
140ee15de9f3 ("loop: add ioctl lock imbalance regression test")
next prev parent reply other threads:[~2018-04-06 17:01 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-06 16:57 [PATCH] loop: fix LOOP_GET_STATUS lock imbalance Omar Sandoval
2018-04-06 17:01 ` Omar Sandoval [this message]
2018-04-06 19:37 ` Jens Axboe
2018-04-07 7:27 ` Tetsuo Handa
2018-04-07 10:55 ` Dmitry Vyukov
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=20180406170142.GB11697@vader \
--to=osandov@osandov.com \
--cc=axboe@fb.com \
--cc=dvyukov@google.com \
--cc=kernel-team@fb.com \
--cc=linux-block@vger.kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
/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