linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Kosina <jikos@kernel.org>
To: Amir Goldstein <amir73il@gmail.com>
Cc: penguin-kernel@i-love.sakura.ne.jp,
	syzbot+6fb572170402d311dd39@syzkaller.appspotmail.com,
	Jan Kara <jack@suse.cz>,
	syzkaller-bugs@googlegroups.com,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
	Petr Mladek <pmladek@suse.com>
Subject: Re: INFO: task hung in fsnotify_connector_destroy_workfn (2)
Date: Mon, 24 Sep 2018 15:19:35 +0200 (CEST)	[thread overview]
Message-ID: <nycvar.YFH.7.76.1809241511500.15880@cbobk.fhfr.pm> (raw)
In-Reply-To: <CAOQ4uxhmFsvy6y6NgcFPs4NF1Lg7J0h2VoWgiL8WfXdDz+Z0FQ@mail.gmail.com>

On Sun, 16 Sep 2018, Amir Goldstein wrote:

> > > syzbot found the following crash on:
> > >
> > > HEAD commit:    11da3a7f84f1 Linux 4.19-rc3
> > > git tree:       upstream
> > > console output: https://syzkaller.appspot.com/x/log.txt?x=141ffbca400000
> > > kernel config:  https://syzkaller.appspot.com/x/.config?x=9917ff4b798e1a1e
> > > dashboard link: https://syzkaller.appspot.com/bug?extid=6fb572170402d311dd39
> > > compiler:       gcc (GCC) 8.0.1 20180413 (experimental)
> > > syz repro:      https://syzkaller.appspot.com/x/repro.syz?x=136a60ae400000
> > >
> > > IMPORTANT: if you fix the bug, please add the following tag to the commit:
> > > Reported-by: syzbot+6fb572170402d311dd39@syzkaller.appspotmail.com
> > >
> >
> > Since it kept printk()ing for at least 93 seconds, it might have kept for 150 seconds.
> >
> > [  174.614333] hid-generic 0000:0000:0000.0003: unknown main item tag 0x0
> > [  268.196102] INFO: task kworker/u4:1:23 blocked for more than 140 seconds.
> >
> > Since the reproducer is simple, this might be lockup due to continuous printk().
> > If syzbot can reliably reproduce this problem using the reproducer, try
> > ratelimiting printk().
> 
> Right.. and I was able to reproduce after setting CONFIG_HID_GENERIC=y
> but unless I am missing something, the core problem doesn't seem related to
> fsnotify and $SUBJECT, so CCing HID maintainer.

Alright, so you're basically triggering a never-ending flow of kmsgs being 
printed out from HID parser due to doing crazy things with the parser, and 
that causes the issues for the kworker trying to flush them out.

I guess the patch below fixes it, however the kworker should not really be 
blocked by this I think ... adding a few more printk folks to double-check 
why the kworker would get stuck due to massive printk() flood.

diff --git a/include/linux/hid.h b/include/linux/hid.h
index d44a78362942..b81332fe85a4 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -1157,22 +1157,22 @@ do {									\
 } while (0)
 
 #define hid_printk(level, hid, fmt, arg...)		\
-	dev_printk(level, &(hid)->dev, fmt, ##arg)
+	dev_printk_ratelimited(level, &(hid)->dev, fmt, ##arg)
 #define hid_emerg(hid, fmt, arg...)			\
-	dev_emerg(&(hid)->dev, fmt, ##arg)
+	dev_emerg_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_crit(hid, fmt, arg...)			\
-	dev_crit(&(hid)->dev, fmt, ##arg)
+	dev_crit_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_alert(hid, fmt, arg...)			\
-	dev_alert(&(hid)->dev, fmt, ##arg)
+	dev_alert_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_err(hid, fmt, arg...)			\
-	dev_err(&(hid)->dev, fmt, ##arg)
+	dev_err_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_notice(hid, fmt, arg...)			\
-	dev_notice(&(hid)->dev, fmt, ##arg)
+	dev_notice_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_warn(hid, fmt, arg...)			\
-	dev_warn(&(hid)->dev, fmt, ##arg)
+	dev_warn_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_info(hid, fmt, arg...)			\
-	dev_info(&(hid)->dev, fmt, ##arg)
+	dev_info_ratelimited(&(hid)->dev, fmt, ##arg)
 #define hid_dbg(hid, fmt, arg...)			\
-	dev_dbg(&(hid)->dev, fmt, ##arg)
+	dev_dbg_ratelimited(&(hid)->dev, fmt, ##arg)
 
 #endif

-- 
Jiri Kosina
SUSE Labs


  reply	other threads:[~2018-09-24 13:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-15  2:33 INFO: task hung in fsnotify_connector_destroy_workfn (2) syzbot
2018-09-15 17:25 ` Tetsuo Handa
2018-09-15 23:05   ` Amir Goldstein
2018-09-24 13:19     ` Jiri Kosina [this message]
2018-09-24 13:31       ` Dmitry Vyukov
2018-09-24 14:03         ` Tetsuo Handa
2018-09-25  8:55       ` Petr Mladek
2018-09-25 12:30         ` Tetsuo Handa

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=nycvar.YFH.7.76.1809241511500.15880@cbobk.fhfr.pm \
    --to=jikos@kernel.org \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=pmladek@suse.com \
    --cc=sergey.senozhatsky@gmail.com \
    --cc=syzbot+6fb572170402d311dd39@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.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;
as well as URLs for NNTP newsgroup(s).