Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-25 Thread Tejun Heo
return; > } > > part in __queue_work(), aren't you? But since flush_work() is used for > waiting for > a work to complete, that work can be either queued state (list_empty() == > false) or > not queued state (list_empty() == true). Thus, I don't think that

Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-22 Thread Daniel Jordan
return; > } > > part in __queue_work(), aren't you? But since flush_work() is used for > waiting for > a work to complete, that work can be either queued state (list_empty() == > false) or > not queued state (list_empty() == true). Thus, I don't thi

Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-22 Thread Tetsuo Handa
e) or not queued state (list_empty() == true). Thus, I don't think that flush_work() can use list_empty() for checking whether that work was initialized. [PATCH v2] workqueue: Try to catch flush_work() without INIT_WORK(). syzbot found a flush_work() caller who forgot to call INIT_WORK() because

Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-22 Thread Daniel Jordan
On Sat, Jan 19, 2019 at 11:41:22AM +0900, Tetsuo Handa wrote: > On 2019/01/19 4:48, Daniel Jordan wrote: > > On Sat, Jan 19, 2019 at 02:04:58AM +0900, Tetsuo Handa wrote: > > __queue_work has a sanity check already for work, but using list_empty. > > Seems > > slightly better to be consistent? >

Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-18 Thread Tetsuo Handa
On 2019/01/19 4:48, Daniel Jordan wrote: > On Sat, Jan 19, 2019 at 02:04:58AM +0900, Tetsuo Handa wrote: >> syzbot found a flush_work() caller who forgot to call INIT_WORK() >> because that work_struct was allocated by kzalloc(). But the message >> >> INFO: trying to register non-static key. >>

Re: [PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-18 Thread Daniel Jordan
On Sat, Jan 19, 2019 at 02:04:58AM +0900, Tetsuo Handa wrote: > syzbot found a flush_work() caller who forgot to call INIT_WORK() > because that work_struct was allocated by kzalloc(). But the message > > INFO: trying to register non-static key. > the code is fine but needs lockdep

[PATCH] workqueue: Try to catch flush_work() without INIT_WORK().

2019-01-18 Thread Tetsuo Handa
syzbot found a flush_work() caller who forgot to call INIT_WORK() because that work_struct was allocated by kzalloc(). But the message INFO: trying to register non-static key. the code is fine but needs lockdep annotation. turning off the locking correctness validator. by