From: Pavel Skripkin <paskripkin@gmail.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: adilger.kernel@dilger.ca, johann@whamcloud.com,
linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com
Subject: Re: [PATCH] ext4: avoid huge mmp update interval value
Date: Thu, 5 Aug 2021 23:12:42 +0300 [thread overview]
Message-ID: <2e940500-6d77-2871-407b-201ca29f24fc@gmail.com> (raw)
In-Reply-To: <YQw/2PuZ8z22Qice@mit.edu>
On 8/5/21 10:45 PM, Theodore Ts'o wrote:
> On Thu, Aug 05, 2021 at 06:14:18PM +0300, Pavel Skripkin wrote:
>> Syzbot reported task hung bug in ext4_fill_super(). The problem was in
>> too huge mmp update interval.
>>
>> Syzkaller reproducer setted s_mmp_update_interval to 39785 seconds. This
>> update interaval is unreasonable huge and it can cause tasks to hung on
>> kthread_stop() call, since it will wait until timeout timer expires.
>
> I must be missing something. kthread_stop() should wake up the
> kmmpd() thread, which should see kthread_should_stop(), and then it
> should exit. What is causing it to wait until the timeout timer
> expires?
>
> - Ted
>
Hi, Ted!
I guess, I've explained my idea badly, sorry :)
I mean, that there is a chance to hit this situation:
CPU0 CPU1
kthread_should_stop() <-- false
kthread_stop()
set_bit(KTHREAD_SHOULD_STOP)
wake_up_process()
wait_for_completion()
schedule_timeout_interruptible()
*waits until timer expires*
Since there wasn't any validation checks for mmp_update_interval, CPU0
will wait for up to (1 << 16) seconds (s_mmp_update_interval it __le16).
With regards,
Pavel Skripkin
next prev parent reply other threads:[~2021-08-05 20:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-05 15:14 [PATCH] ext4: avoid huge mmp update interval value Pavel Skripkin
2021-08-05 19:45 ` Theodore Ts'o
2021-08-05 20:12 ` Pavel Skripkin [this message]
2021-08-05 22:59 ` Dave Chinner
2021-08-06 10:20 ` Pavel Skripkin
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=2e940500-6d77-2871-407b-201ca29f24fc@gmail.com \
--to=paskripkin@gmail.com \
--cc=adilger.kernel@dilger.ca \
--cc=johann@whamcloud.com \
--cc=linux-ext4@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com \
--cc=tytso@mit.edu \
/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