Re: [PATCH] workqueue: Fix NULL pointer dereference

2017-10-26 Thread Li Bin
Hi, Jiangshan on 2017/10/26 23:55, Lai Jiangshan wrote: > On Tue, Oct 24, 2017 at 9:18 AM, Li Bin wrote: > > I remember that softirq can be invoked when irq_eixt(), > and in this case the current->current_pwq is also NULL > if __queue_work() is called in the soft irq. > > So in_task() might b

Re: [PATCH] workqueue: Fix NULL pointer dereference

2017-10-26 Thread Tejun Heo
Hello, On Thu, Oct 26, 2017 at 11:55:00PM +0800, Lai Jiangshan wrote: > I remember that softirq can be invoked when irq_eixt(), > and in this case the current->current_pwq is also NULL > if __queue_work() is called in the soft irq. > > So in_task() might be better than !in_irq() for the fix? Rev

Re: [PATCH] workqueue: Fix NULL pointer dereference

2017-10-26 Thread Lai Jiangshan
On Tue, Oct 24, 2017 at 9:18 AM, Li Bin wrote: > When queue_work() is used in irq handler, there is a potential > case that trigger NULL pointer dereference. > > worker_thread() > |-spin_lock_irq() > |-process_one_work() > |-

Re: [PATCH] workqueue: Fix NULL pointer dereference

2017-10-24 Thread Tejun Heo
On Tue, Oct 24, 2017 at 09:18:34AM +0800, Li Bin wrote: > When queue_work() is used in irq handler, there is a potential > case that trigger NULL pointer dereference. > > worker_thread() > |-spin_lock_irq() > |-process_one_work() >

[PATCH] workqueue: Fix NULL pointer dereference

2017-10-23 Thread Li Bin
When queue_work() is used in irq handler, there is a potential case that trigger NULL pointer dereference. worker_thread() |-spin_lock_irq() |-process_one_work() |-worker->current_pwq = pwq |-spin_unlock_irq()