[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20121016232040.GH16166@google.com>
Date: Tue, 16 Oct 2012 16:20:40 -0700
From: Tejun Heo <tj@...nel.org>
To: Jun'ichi Nomura <j-nomura@...jp.nec.com>
Cc: Vivek Goyal <vgoyal@...hat.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] Fix use-after-free of q->root_blkg and q->root_rl.blkg
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 there are
> > no more request lists hence and return NULL.
> >
> > Current code:
> > if (rl == &q->root_rl) {
> > ent = &q->blkg_list;
> >
> > Modified code:
> > if (rl == &q->root_rl) {
> > ent = &q->blkg_list;
> > /* There are no more block groups, hence no request lists */
> > if (list_empty(ent))
> > return NULL;
> > }
Do we need this at all? q->root_blkg being NULL is completely fine
there and the comparison would work as expected, no?
Thanks.
--
tejun
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists