Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-21 Thread Jun'ichi Nomura
On 10/19/12 23:53, Vivek Goyal wrote: > On Thu, Oct 18, 2012 at 02:20:53PM -0700, Tejun Heo wrote: >> Hey, Vivek. >> >> On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: >>> Tejun, for the sake of readability, are you fine with keeping the original >>> check and original patch which I

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-21 Thread Jun'ichi Nomura
On 10/19/12 23:53, Vivek Goyal wrote: On Thu, Oct 18, 2012 at 02:20:53PM -0700, Tejun Heo wrote: Hey, Vivek. On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: Tejun, for the sake of readability, are you fine with keeping the original check and original patch which I had acked.

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-19 Thread Vivek Goyal
On Thu, Oct 18, 2012 at 02:20:53PM -0700, Tejun Heo wrote: > Hey, Vivek. > > On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: > > Tejun, for the sake of readability, are you fine with keeping the original > > check and original patch which I had acked. > > Can you please send another

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-19 Thread Vivek Goyal
On Thu, Oct 18, 2012 at 02:20:53PM -0700, Tejun Heo wrote: Hey, Vivek. On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: Tejun, for the sake of readability, are you fine with keeping the original check and original patch which I had acked. Can you please send another patch to

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-18 Thread Tejun Heo
Hey, Vivek. On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: > Tejun, for the sake of readability, are you fine with keeping the original > check and original patch which I had acked. Can you please send another patch to change that? It really isn't a related change and I don't

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-18 Thread Vivek Goyal
On Thu, Oct 18, 2012 at 11:56:34AM +0900, Jun'ichi Nomura wrote: [..] > >>> if (ent == >root_blkg->q_node) > >> > >> So ent is not >root_blkg->q_node. > > > > If q->root_blkg is NULL, will it not lead to NULL pointer dereference. > > (q->root_blkg->q_node). > > It's not dereferenced.

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-18 Thread Vivek Goyal
On Thu, Oct 18, 2012 at 11:56:34AM +0900, Jun'ichi Nomura wrote: [..] if (ent == q-root_blkg-q_node) So ent is not q-root_blkg-q_node. If q-root_blkg is NULL, will it not lead to NULL pointer dereference. (q-root_blkg-q_node). It's not dereferenced. Ok. We are taking

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-18 Thread Tejun Heo
Hey, Vivek. On Thu, Oct 18, 2012 at 09:31:49AM -0400, Vivek Goyal wrote: Tejun, for the sake of readability, are you fine with keeping the original check and original patch which I had acked. Can you please send another patch to change that? It really isn't a related change and I don't wanna

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-17 Thread Jun'ichi Nomura
On 10/17/12 22:47, Vivek Goyal wrote: > On Wed, Oct 17, 2012 at 09:02:22AM +0900, Jun'ichi Nomura wrote: >> On 10/17/12 08:20, Tejun Heo wrote: >> -if (ent == >root_blkg->q_node) >> +if (q->root_blkg && ent == >root_blkg->q_node) > > Can we fix it little

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-17 Thread Vivek Goyal
On Wed, Oct 17, 2012 at 09:02:22AM +0900, Jun'ichi Nomura wrote: > On 10/17/12 08:20, Tejun Heo wrote: > -if (ent == >root_blkg->q_node) > +if (q->root_blkg && ent == >root_blkg->q_node) > >>> > >>> Can we fix it little differently. Little earlier in the code, we check

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-17 Thread Vivek Goyal
On Wed, Oct 17, 2012 at 09:02:22AM +0900, Jun'ichi Nomura wrote: On 10/17/12 08:20, Tejun Heo wrote: -if (ent == q-root_blkg-q_node) +if (q-root_blkg ent == q-root_blkg-q_node) Can we fix it little differently. Little earlier in the code, we check for if q-blkg_list is

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-17 Thread Jun'ichi Nomura
On 10/17/12 22:47, Vivek Goyal wrote: On Wed, Oct 17, 2012 at 09:02:22AM +0900, Jun'ichi Nomura wrote: On 10/17/12 08:20, Tejun Heo wrote: -if (ent == q-root_blkg-q_node) +if (q-root_blkg ent == q-root_blkg-q_node) Can we fix it little differently. Little earlier in the

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-16 Thread Jun'ichi Nomura
On 10/17/12 08:20, Tejun Heo wrote: - if (ent == >root_blkg->q_node) + if (q->root_blkg && ent == >root_blkg->q_node) >>> >>> Can we fix it little differently. Little earlier in the code, we check for >>> if q->blkg_list is empty, then all the groups are gone, and there are >>> no more

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-16 Thread Tejun Heo
Hello, On Thu, Oct 11, 2012 at 10:31:46AM +0900, Jun'ichi Nomura wrote: > >> - if (ent == >root_blkg->q_node) > >> + if (q->root_blkg && ent == >root_blkg->q_node) > > > > Can we fix it little differently. Little earlier in the code, we check for > > if q->blkg_list is empty, then all the

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-16 Thread Tejun Heo
Hello, On Thu, Oct 11, 2012 at 10:31:46AM +0900, Jun'ichi Nomura wrote: - if (ent == q-root_blkg-q_node) + if (q-root_blkg ent == q-root_blkg-q_node) Can we fix it little differently. Little earlier in the code, we check for if q-blkg_list is empty, then all the groups are gone, and

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-16 Thread Jun'ichi Nomura
On 10/17/12 08:20, Tejun Heo wrote: - if (ent == q-root_blkg-q_node) + if (q-root_blkg ent == q-root_blkg-q_node) Can we fix it little differently. Little earlier in the code, we check for if q-blkg_list is empty, then all the groups are gone, and there are no more request lists hence and

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-11 Thread Vivek Goyal
On Thu, Oct 11, 2012 at 10:31:46AM +0900, Jun'ichi Nomura wrote: [..] > Below is the updated version of the patch. > > == > blk_put_rl() does not call blkg_put() for q->root_rl because we > don't take request list reference on

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-11 Thread Vivek Goyal
On Thu, Oct 11, 2012 at 10:31:46AM +0900, Jun'ichi Nomura wrote: [..] Below is the updated version of the patch. == blk_put_rl() does not call blkg_put() for q-root_rl because we don't take request list reference on

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-10 Thread Jun'ichi Nomura
Hi Vivek, thank you for comments. On 10/11/12 00:59, Vivek Goyal wrote: > I think patch looks reasonable to me. Just that some more description > would be nice. In fact, I will prefer some code comments too as I > had to scratch my head for a while to figure out how did we reach here. > > So

Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-10 Thread Vivek Goyal
On Wed, Oct 10, 2012 at 02:11:03PM +0900, Jun'ichi Nomura wrote: > I got system stall after the following warning with 3.6: > > > WARNING: at /work/build/linux/block/blk-cgroup.h:250 blk_put_rl+0x4d/0x95() > > Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf > > ipt_REJEC >

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-10 Thread Vivek Goyal
On Wed, Oct 10, 2012 at 02:11:03PM +0900, Jun'ichi Nomura wrote: I got system stall after the following warning with 3.6: WARNING: at /work/build/linux/block/blk-cgroup.h:250 blk_put_rl+0x4d/0x95() Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf ipt_REJEC T

Re: [PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-10 Thread Jun'ichi Nomura
Hi Vivek, thank you for comments. On 10/11/12 00:59, Vivek Goyal wrote: I think patch looks reasonable to me. Just that some more description would be nice. In fact, I will prefer some code comments too as I had to scratch my head for a while to figure out how did we reach here. So looks

[PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg

2012-10-09 Thread Jun'ichi Nomura
I got system stall after the following warning with 3.6: > WARNING: at /work/build/linux/block/blk-cgroup.h:250 blk_put_rl+0x4d/0x95() > Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf > ipt_REJEC > T nf_conntrack_ipv4 nf_defrag_ipv4 > Pid: 0, comm: swapper/0 Not tainted

[PATCH] Fix use-after-free of q-root_blkg and q-root_rl.blkg

2012-10-09 Thread Jun'ichi Nomura
I got system stall after the following warning with 3.6: WARNING: at /work/build/linux/block/blk-cgroup.h:250 blk_put_rl+0x4d/0x95() Modules linked in: bridge stp llc sunrpc acpi_cpufreq freq_table mperf ipt_REJEC T nf_conntrack_ipv4 nf_defrag_ipv4 Pid: 0, comm: swapper/0 Not tainted 3.6.0