[RFC 1/2] mm, slub: prevent kmalloc_node crashes and memory leaks

Srikar Dronamraju srikar at linux.vnet.ibm.com
Fri Mar 20 01:05:49 AEDT 2020


* Vlastimil Babka <vbabka at suse.cz> [2020-03-19 14:47:58]:

> ----8<----
> diff --git a/mm/slub.c b/mm/slub.c
> index 17dc00e33115..7113b1f9cd77 100644
> --- a/mm/slub.c
> +++ b/mm/slub.c
> @@ -1973,8 +1973,6 @@ static void *get_partial(struct kmem_cache *s, gfp_t flags, int node,
> 
>  	if (node == NUMA_NO_NODE)
>  		searchnode = numa_mem_id();
> -	else if (!node_present_pages(node))
> -		searchnode = node_to_mem_node(node);
> 
>  	object = get_partial_node(s, get_node(s, searchnode), c, flags);

Are we okay with passing a node to get_partial_node with !NUMA_NO_NODE and
!N_MEMORY including possible nodes?

>  	if (object || node != NUMA_NO_NODE)

-- 
Thanks and Regards
Srikar Dronamraju



More information about the Linuxppc-dev mailing list