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

2018-02-21 Thread Yonghong Song
On 2/21/18 7:40 PM, Eric Dumazet wrote: On Tue, 2018-02-13 at 19:17 -0800, Alexei Starovoitov wrote: On Tue, Feb 13, 2018 at 07:00:21PM -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.

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

2018-02-21 Thread Eric Dumazet
On Tue, 2018-02-13 at 19:17 -0800, Alexei Starovoitov wrote: > On Tue, Feb 13, 2018 at 07:00:21PM -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

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

2018-02-13 Thread Alexei Starovoitov
On Tue, Feb 13, 2018 at 07:00:21PM -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.

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

2018-02-13 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