[PATCH] flowtop: Use RCU flow deletion from process entry

6 views
Skip to first unread message

Vadim Kochan

unread,
Dec 17, 2017, 4:23:18 PM12/17/17
to netsn...@googlegroups.com, tkla...@distanz.ch, dan...@iogearbox.net, Vadim Kochan
Use cds_list_del_rcu for safer deletion flow from the process flow
list to prevent possible use-after-free by UI thread when it is
refreshing the processes.

It may fix the #183 issue.

Signed-off-by: Vadim Kochan <vad...@gmail.com>
---
flowtop.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/flowtop.c b/flowtop.c
index 0a3c514..8b69d65 100644
--- a/flowtop.c
+++ b/flowtop.c
@@ -477,7 +477,7 @@ static int flow_list_del_entry(struct flow_list *fl, const struct nf_conntrack *
n = flow_list_find_id(fl, nfct_get_attr_u32(ct, ATTR_ID));
if (n) {
if (n->proc) {
- cds_list_del(&n->proc_head);
+ cds_list_del_rcu(&n->proc_head);
n->proc->flows_count--;
}

--
2.14.1

Tobias Klauser

unread,
Dec 18, 2017, 8:46:56 AM12/18/17
to Vadim Kochan, netsn...@googlegroups.com, dan...@iogearbox.net
On 2017-12-17 at 22:25:40 +0100, Vadim Kochan <vad...@gmail.com> wrote:
> Use cds_list_del_rcu for safer deletion flow from the process flow
> list to prevent possible use-after-free by UI thread when it is
> refreshing the processes.
>
> It may fix the #183 issue.
>
> Signed-off-by: Vadim Kochan <vad...@gmail.com>

Applied, thank you Vadim!
Reply all
Reply to author
Forward
0 new messages