Re: [PATCH net-next] bpf, lpm: fix overflows in trie_alloc checks

2017-02-08 Thread David Miller
From: Daniel Borkmann Date: Wed, 8 Feb 2017 01:19:43 +0100 > Cap the maximum (total) value size and bail out if larger than > KMALLOC_MAX_SIZE > as otherwise it doesn't make any sense to proceed further, since we're > guaranteed to fail to allocate elements anyway in

[PATCH net-next] bpf, lpm: fix overflows in trie_alloc checks

2017-02-07 Thread Daniel Borkmann
Cap the maximum (total) value size and bail out if larger than KMALLOC_MAX_SIZE as otherwise it doesn't make any sense to proceed further, since we're guaranteed to fail to allocate elements anyway in lpm_trie_node_alloc(); likleyhood of failure is still high for large values, though, similarly as