LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Pavel Skripkin <paskripkin@gmail.com>
To: syzbot <syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com>,
	adilger.kernel@dilger.ca, clang-built-linux@googlegroups.com,
	linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org,
	nathan@kernel.org, ndesaulniers@google.com,
	syzkaller-bugs@googlegroups.com, tytso@mit.edu
Subject: Re: [syzbot] INFO: task hung in ext4_fill_super
Date: Thu, 5 Aug 2021 17:26:22 +0300	[thread overview]
Message-ID: <1e291320-3ad3-aa21-77c6-c71da9d32fdb@gmail.com> (raw)
In-Reply-To: <0000000000004c80e405c4df1a2d@google.com>

[-- Attachment #1: Type: text/plain, Size: 2972 bytes --]

On 6/16/21 12:56 PM, syzbot wrote:
> Hello,
> 
> syzbot found the following issue on:
> 
> HEAD commit:    f21b807c Merge tag 'drm-fixes-2021-06-11' of git://anongit..
> git tree:       upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=165fca57d00000
> kernel config:  https://syzkaller.appspot.com/x/.config?x=30f476588412c065
> dashboard link: https://syzkaller.appspot.com/bug?extid=c9ff4822a62eee994ea3
> syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=17d19ce0300000
> C reproducer:   https://syzkaller.appspot.com/x/repro.c?x=108d7988300000
> 
> Bisection is inconclusive: the issue happens on the oldest tested release.
> 
> bisection log:  https://syzkaller.appspot.com/x/bisect.txt?x=1646b8d0300000
> final oops:     https://syzkaller.appspot.com/x/report.txt?x=1546b8d0300000
> console output: https://syzkaller.appspot.com/x/log.txt?x=1146b8d0300000
> 
> IMPORTANT: if you fix the issue, please add the following tag to the commit:
> Reported-by: syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com
> 
> INFO: task syz-executor768:8567 blocked for more than 143 seconds.
>        Not tainted 5.13.0-rc5-syzkaller #0
> "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
> task:syz-executor768 state:D stack:27544 pid: 8567 ppid:  8423 flags:0x00004004
> Call Trace:
>   context_switch kernel/sched/core.c:4339 [inline]
>   __schedule+0x916/0x23e0 kernel/sched/core.c:5147
>   schedule+0xcf/0x270 kernel/sched/core.c:5226
>   schedule_timeout+0x1db/0x250 kernel/time/timer.c:1868
>   do_wait_for_common kernel/sched/completion.c:85 [inline]
>   __wait_for_common kernel/sched/completion.c:106 [inline]
>   wait_for_common kernel/sched/completion.c:117 [inline]
>   wait_for_completion+0x168/0x270 kernel/sched/completion.c:138
>   kthread_stop+0x17a/0x720 kernel/kthread.c:642
>   ext4_fill_super+0x87ac/0xdfa0 fs/ext4/super.c:5190
>   mount_bdev+0x34d/0x410 fs/super.c:1368
>   legacy_get_tree+0x105/0x220 fs/fs_context.c:592
>   vfs_get_tree+0x89/0x2f0 fs/super.c:1498
>   do_new_mount fs/namespace.c:2905 [inline]
>   path_mount+0x132a/0x1fa0 fs/namespace.c:3235
>   do_mount fs/namespace.c:3248 [inline]
>   __do_sys_mount fs/namespace.c:3456 [inline]
>   __se_sys_mount fs/namespace.c:3433 [inline]
>   __x64_sys_mount+0x27f/0x300 fs/namespace.c:3433
>   do_syscall_64+0x3a/0xb0 arch/x86/entry/common.c:47
>   entry_SYSCALL_64_after_hwframe+0x44/0xae
> RIP: 0033:0x445b2a
> RSP: 002b:00007ffc5efbf598 EFLAGS: 00000202 ORIG_RAX: 00000000000000a5
> RAX: ffffffffffffffda RBX: 00007ffc5efbf5f0 RCX: 0000000000445b2a
> RDX: 0000000020000000 RSI: 00000000200000c0 RDI: 00007ffc5efbf5b0
> RBP: 00007ffc5efbf5b0 R08: 00007ffc5efbf5f0 R09: 0000000000000000
> R10: 0000000000000000 R11: 0000000000000202 R12: 00000000200003f8
> R13: 0000000000000003 R14: 0000000000000004 R15: 0000000000000005
> 

#syz test
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master


With regards,
Pavel Skripkin

[-- Attachment #2: 0001-ext4-avoid-huge-mmp-update-interval-value.patch --]
[-- Type: text/x-patch, Size: 1592 bytes --]

From 9eb3e2f727e1c33ec39c28694a1528b9cc4a32eb Mon Sep 17 00:00:00 2001
From: Pavel Skripkin <paskripkin@gmail.com>
Date: Thu, 5 Aug 2021 17:23:40 +0300
Subject: [PATCH] ext4: avoid huge mmp update interval value

/* .. */

Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
---
 fs/ext4/mmp.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/fs/ext4/mmp.c b/fs/ext4/mmp.c
index bc364c119af6..2f632344d38c 100644
--- a/fs/ext4/mmp.c
+++ b/fs/ext4/mmp.c
@@ -7,6 +7,9 @@
 
 #include "ext4.h"
 
+#define EXT4_KMMP_MAX_INTERVAL		100
+#define EXT4_KMMP_MIN_INTERVAL		5
+
 /* Checksumming functions */
 static __le32 ext4_mmp_csum(struct super_block *sb, struct mmp_struct *mmp)
 {
@@ -140,6 +143,11 @@ static int kmmpd(void *data)
 	unsigned long diff;
 	int retval;
 
+	/* We should avoid unreasonale huge update interval, since it can cause
+	 * task hung bug on umount or on error handling path in ext4_fill_super()
+	 */
+	mmp_update_interval = clamp(mmp_update_interval, EXT4_KMMP_MIN_INTERVAL, EXT4_KMMP_MAX_INTERVAL);
+
 	mmp_block = le64_to_cpu(es->s_mmp_block);
 	mmp = (struct mmp_struct *)(bh->b_data);
 	mmp->mmp_time = cpu_to_le64(ktime_get_real_seconds());
@@ -156,6 +164,9 @@ static int kmmpd(void *data)
 	memcpy(mmp->mmp_nodename, init_utsname()->nodename,
 	       sizeof(mmp->mmp_nodename));
 
+	ext4_msg(sb, KERN_INFO, "Started kmmp thread with update interval = %u\n",
+		 mmp_update_interval);
+
 	while (!kthread_should_stop() && !sb_rdonly(sb)) {
 		if (!ext4_has_feature_mmp(sb)) {
 			ext4_warning(sb, "kmmpd being stopped since MMP feature"
-- 
2.32.0


  parent reply	other threads:[~2021-08-05 14:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16  9:56 syzbot
2021-06-16 16:22 ` Pavel Skripkin
2021-06-16 18:28   ` syzbot
2021-08-05 14:26 ` Pavel Skripkin [this message]
2021-08-05 14:46   ` syzbot
2021-08-06  7:45     ` Pavel Skripkin
2021-08-06 10:14       ` syzbot

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=1e291320-3ad3-aa21-77c6-c71da9d32fdb@gmail.com \
    --to=paskripkin@gmail.com \
    --cc=adilger.kernel@dilger.ca \
    --cc=clang-built-linux@googlegroups.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=syzbot+c9ff4822a62eee994ea3@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=tytso@mit.edu \
    --subject='Re: [syzbot] INFO: task hung in ext4_fill_super' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).