mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
To: Tejun Heo <tj@kernel.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Subject: workqueue: Is flush_work() without INIT_WORK() OK?
Date: Fri, 18 Jan 2019 20:58:49 +0900	[thread overview]
Message-ID: <7d751e65-e695-e23b-9cec-ef3f44289a56@i-love.sakura.ne.jp> (raw)

Hello, Tejun.

syzbot is reporting "INFO: trying to register non-static key in __flush_work"
at https://syzkaller.appspot.com/bug?id=a5954455fcfa51c29ca2ab55b203076337e1c770 ,
and I think that the caller is passing a work_struct allocated by kzalloc() to
flush_work().

But I can't judge which problem (the caller side or the WQ side) without knowing
the behavior of

	struct work_struct work;
	memset(&work, 0, sizeof(work));
	flush_work(&work);

. Is this behavior defined as "safe and no-op"? If this should be "safe and no-op",
we need to check whether INIT_WORK() was called before starting lockdep checks
at __flush_work(). If this is not "safe and no-op", I want to emit a warning if
INIT_WORK() was not called.

             reply	other threads:[~2019-01-18 11:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-18 11:58 Tetsuo Handa [this message]
2019-01-18 14:05 ` Tejun Heo

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=7d751e65-e695-e23b-9cec-ef3f44289a56@i-love.sakura.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tj@kernel.org \
    /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

all inboxes | Powered by JetHome®