[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20170905.091027.204977527174006202.davem@davemloft.net>
Date: Tue, 05 Sep 2017 09:10:27 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: netdev@...r.kernel.org, kafai@...com, daniel@...earbox.net,
ast@...com
Subject: Re: [PATCH net-next] bpf: fix numa_node validation
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Mon, 04 Sep 2017 22:41:02 -0700
> From: Eric Dumazet <edumazet@...gle.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 <edumazet@...gle.com>
Applied, thanks.
Powered by blists - more mailing lists