Re: [PATCH bpf] bpf: fix memory leak in lpm_trie map_free callback function

2018-02-13 Thread Yonghong Song
On 2/13/18 5:11 PM, Daniel Borkmann wrote: Hi Yonghong, On 02/12/2018 10:58 PM, Yonghong Song wrote: There is a memory leak happening in lpm_trie map_free callback function trie_free. The trie structure itself does not get freed. Also, trie_free function did not do synchronize_rcu before

Re: [PATCH bpf] bpf: fix memory leak in lpm_trie map_free callback function

2018-02-13 Thread Daniel Borkmann
Hi Yonghong, On 02/12/2018 10:58 PM, Yonghong Song wrote: > There is a memory leak happening in lpm_trie map_free callback > function trie_free. The trie structure itself does not get freed. > > Also, trie_free function did not do synchronize_rcu before freeing > various data structures. This is

Re: [PATCH bpf] bpf: fix memory leak in lpm_trie map_free callback function

2018-02-12 Thread Eric Dumazet
On Mon, 2018-02-12 at 14:15 -0800, Eric Dumazet wrote: > On Mon, 2018-02-12 at 13:58 -0800, Yonghong Song wrote: > > There is a memory leak happening in lpm_trie map_free callback > > function trie_free. The trie structure itself does not get freed. > > > > Also, trie_free function did not do

Re: [PATCH bpf] bpf: fix memory leak in lpm_trie map_free callback function

2018-02-12 Thread Eric Dumazet
On Mon, 2018-02-12 at 13:58 -0800, Yonghong Song wrote: > There is a memory leak happening in lpm_trie map_free callback > function trie_free. The trie structure itself does not get freed. > > Also, trie_free function did not do synchronize_rcu before freeing > various data structures. This is

[PATCH bpf] bpf: fix memory leak in lpm_trie map_free callback function

2018-02-12 Thread Yonghong Song
There is a memory leak happening in lpm_trie map_free callback function trie_free. The trie structure itself does not get freed. Also, trie_free function did not do synchronize_rcu before freeing various data structures. This is incorrect as some rcu_read_lock region(s) for lookup, update, delete