Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-02 Thread Helge Deller
On 10/02/2013 12:50 AM, James Bottomley wrote: > On Wed, 2013-10-02 at 00:07 +0200, Helge Deller wrote: >> On 10/01/2013 11:40 PM, James Bottomley wrote: >>> On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: Hello, On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: >

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread John David Anglin
On 1-Oct-13, at 6:50 PM, James Bottomley wrote: On Wed, 2013-10-02 at 00:07 +0200, Helge Deller wrote: On 10/01/2013 11:40 PM, James Bottomley wrote: On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: Hello, On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: print_worker_info()

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread John David Anglin
On 1-Oct-13, at 6:50 PM, James Bottomley wrote: On Wed, 2013-10-02 at 00:07 +0200, Helge Deller wrote: On 10/01/2013 11:40 PM, James Bottomley wrote: On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: Hello, On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: print_worker_info()

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread James Bottomley
On Wed, 2013-10-02 at 00:07 +0200, Helge Deller wrote: > On 10/01/2013 11:40 PM, James Bottomley wrote: > > On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: > >> Hello, > >> > >> On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: > >>> print_worker_info() includes no validity check on

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Tejun Heo
On Tue, Oct 01, 2013 at 06:40:23PM -0400, Tejun Heo wrote: > Because it is using probe_kernel_read() and such test wouldn't mean > anything? It may be NULL, it may be 1 or full Fs. NULL is just one > of many illegal pointers which may happen. Why add code which doesn't > achieve anything when yo

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Tejun Heo
Hello, On Wed, Oct 02, 2013 at 12:34:53AM +0200, Helge Deller wrote: > Sure, probe_kernel_read() takes care that no segfaults will happen. > Nevertheless, if we know that "pwq" might become NULL, why access pwq->wq at > all? > struct pool_workqueue *pwq = NULL; > probe_kernel_read(&wq, &pwq>w

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Helge Deller
On 10/01/2013 11:07 PM, Tejun Heo wrote: > On Tue, Oct 01, 2013 at 05:03:48PM -0400, Tejun Heo wrote: >> On Tue, Oct 01, 2013 at 10:53:31PM +0200, Helge Deller wrote: >>> So, in summary my patch here is not really necessary, but for the sake of >>> clean code I think it doesn't hurt either and as s

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Helge Deller
On 10/01/2013 11:40 PM, James Bottomley wrote: > On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: >> Hello, >> >> On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: >>> print_worker_info() includes no validity check on the pwq and wq >>> pointers before handing them over to the probe_

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread James Bottomley
On Tue, 2013-10-01 at 16:43 -0400, Tejun Heo wrote: > Hello, > > On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: > > print_worker_info() includes no validity check on the pwq and wq > > pointers before handing them over to the probe_kernel_read() functions. > > > > It seems that mos

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Tejun Heo
On Tue, Oct 01, 2013 at 05:03:48PM -0400, Tejun Heo wrote: > On Tue, Oct 01, 2013 at 10:53:31PM +0200, Helge Deller wrote: > > So, in summary my patch here is not really necessary, but for the sake of > > clean code I think it doesn't hurt either and as such it would be nice if > > you could apply

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Tejun Heo
On Tue, Oct 01, 2013 at 10:53:31PM +0200, Helge Deller wrote: > So, in summary my patch here is not really necessary, but for the sake of > clean code I think it doesn't hurt either and as such it would be nice if > you could apply it. What? function *must* take any value and try to access it and

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Helge Deller
On 10/01/2013 10:43 PM, Tejun Heo wrote: > Hello, > > On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: >> print_worker_info() includes no validity check on the pwq and wq >> pointers before handing them over to the probe_kernel_read() functions. >> >> It seems that most architectures

Re: [PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Tejun Heo
Hello, On Tue, Oct 01, 2013 at 10:35:20PM +0200, Helge Deller wrote: > print_worker_info() includes no validity check on the pwq and wq > pointers before handing them over to the probe_kernel_read() functions. > > It seems that most architectures don't care about that, but at least on > the paris

[PATCH] [workqueue] check values of pwq and wq in print_worker_info() before use

2013-10-01 Thread Helge Deller
print_worker_info() includes no validity check on the pwq and wq pointers before handing them over to the probe_kernel_read() functions. It seems that most architectures don't care about that, but at least on the parisc architecture this leads to a kernel crash since accesses to page zero are prot