Subject: Re: [PATCH net-next 13/13] netfilter: ctnetlink: restrict expectfn to helper

From: Pablo Neira Ayuso <[email-masked]>
Date: Wed, 8 Apr 2026 02:05:37 +0200

On Tue, Apr 07, 2026 at 04:27:26PM +0200, Florian Westphal wrote:
> Florian Westphal <[email-masked]> wrote:
> >  	list_for_each_entry_rcu(cur, &nf_ct_helper_expectfn_list, head) {
> > -		if (!strcmp(cur->name, name)) {
> > +		if ((cur->helper && !strcmp(cur->helper, helper)) ||
> > +		    !strcmp(cur->name, name)) {
> 
> Sigh, I don't know why I did not see this earlier.  It looks wrong.
> 
> Should this be:
> 
> if ((cur->helper && strcmp(cur->helper, helper))
> 	continue; // skip, name doesn't match
> 
> if (!strcmp(cur->name, name)) {
>  ...
> 
> as is, this restriction has no effect in case the requested
> name matches?
> 
> AI suggests
> 
> if ((cur->helper && !strcmp(cur->helper, helper)) &&
>    !strcmp(cur->name, name)) {
> 
> ... but i think thats bogus too.  What to do?
> 
> Send v2 or do you want to followup later?

Keep it back, not urgent.

I should have withdraw this patch, I wanted to use an enum instead of
strings in v2.

Sorry.