From: Eric Dumazet <eric.duma...@gmail.com>
Date: Mon, 04 Sep 2017 22:41:02 -0700

> From: Eric Dumazet <eduma...@google.com>
> 
> syzkaller reported crashes in bpf map creation or map update [1]
> 
> Problem is that nr_node_ids is a signed integer,
> NUMA_NO_NODE is also an integer, so it is very tempting
> to declare numa_node as a signed integer.
> 
> This means the typical test to validate a user provided value :
> 
>         if (numa_node != NUMA_NO_NODE &&
>             (numa_node >= nr_node_ids ||
>              !node_online(numa_node)))
> 
> must be written :
> 
>         if (numa_node != NUMA_NO_NODE &&
>             ((unsigned int)numa_node >= nr_node_ids ||
>              !node_online(numa_node)))
> 
> 
> [1]
 ...
> Fixes: 96eabe7a40aa ("bpf: Allow selecting numa node during map creation")
> Signed-off-by: Eric Dumazet <eduma...@google.com>

Applied, thanks.

Reply via email to