lkml.org 
[lkml]   [2018]   [Apr]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [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.

\
 
 \ /
  Last update: 2018-04-10 14:43    [W:0.104 / U:1.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site