<html>
<head>
<base href="https://bugzilla.netfilter.org/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Calling the nftnl_set_free function may trigger the "double free" problem."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1685#c10">Comment # 10</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED FIXED - Calling the nftnl_set_free function may trigger the "double free" problem."
href="https://bugzilla.netfilter.org/show_bug.cgi?id=1685">bug 1685</a>
from <span class="vcard"><a class="email" href="mailto:pablo@netfilter.org" title="Pablo Neira Ayuso <pablo@netfilter.org>"> <span class="fn">Pablo Neira Ayuso</span></a>
</span></b>
<pre>(In reply to Chen Zhen from <a href="show_bug.cgi?id=1685#c9">comment #9</a>)
<span class="quote">> (In reply to Pablo Neira Ayuso from <a href="show_bug.cgi?id=1685#c8">comment #8</a>)
> > Phil already fix it here:
> >
> > <a href="https://patchwork.ozlabs.org/project/netfilter-devel/patch/20230531123256">https://patchwork.ozlabs.org/project/netfilter-devel/patch/20230531123256</a>.
> > <a href="mailto:4882-1-phil@nwl.cc">4882-1-phil@nwl.cc</a>/
>
> Yes, this patch can fix the problem, but do I think we should add the if
> (s->flags & (1 << NFTNL_SET_EXPR)) judgment to the nftnl_set_free function?</span >
There is NFTNL_SET_EXPRESSIONS that uses this list too.
List would be empty (but correctly initialized) if NFTNL_SET_EXPR or
NFTNL_SET_EXPRESSIONS are unset.
I believe this is sufficient.
<span class="quote">> - list_for_each_entry_safe(expr, next, &s->expr_list, head)
> + if (s->flags & (1 << NFTNL_SET_EXPR)){
> + list_for_each_entry_safe(expr, next, &s->expr_list, head) {
> + list_del(&expr->head);
> nftnl_expr_free(expr);
> + }
> + }</span ></pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>