lkml.org 
[lkml]   [2019]   [Jan]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectworkqueue: Is flush_work() without INIT_WORK() OK?
Date
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.

\
 
 \ /
  Last update: 2019-01-18 12:59    [W:0.552 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site