[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180410124459.GB6334@cmpxchg.org>
Date: Tue, 10 Apr 2018 08:44:59 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Minchan Kim <minchan@...nel.org>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
linux-mm <linux-mm@...ck.org>,
LKML <linux-kernel@...r.kernel.org>, Jan Kara <jack@...e.cz>,
Chris Fries <cfries@...gle.com>
Subject: Re: [PATCH] mm: workingset: fix NULL ptr dereference
On Mon, Apr 09, 2018 at 10:58:15AM +0900, Minchan Kim wrote:
> @@ -428,6 +428,7 @@ radix_tree_node_alloc(gfp_t gfp_mask, struct radix_tree_node *parent,
> ret->exceptional = exceptional;
> ret->parent = parent;
> ret->root = root;
> + INIT_LIST_HEAD(&ret->private_list);
> }
> return ret;
> }
> @@ -2234,7 +2235,6 @@ radix_tree_node_ctor(void *arg)
> struct radix_tree_node *node = arg;
>
> memset(node, 0, sizeof(*node));
> - INIT_LIST_HEAD(&node->private_list);
> }
I have to NAK this.
The slab constructor protocol requires objects to be in their initial
allocation state at the time of being freed. If this isn't the case
here, we need to fix whoever isn't doing this, not the alloc site.
Powered by blists - more mailing lists