From: Willem de Bruijn <willemdebruijn.kernel@gmail.com>
To: Florian Westphal <fw@strlen.de>,
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Cc: Florian Westphal <fw@strlen.de>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Christoph Paasch <cpaasch@apple.com>,
Netfilter <netfilter-devel@vger.kernel.org>,
Paolo Abeni <pabeni@redhat.com>,
netdev@vger.kernel.org, daniel@iogearbox.net,
willemb@google.com
Subject: Re: [PATCH nf] netfilter: nf_reject: init skb->dev for reset packet
Date: Thu, 06 Jun 2024 10:28:24 -0400 [thread overview]
Message-ID: <6661c788553a4_37c46c294fc@willemb.c.googlers.com.notmuch> (raw)
In-Reply-To: <20240606141516.GB9890@breakpoint.cc>
Florian Westphal wrote:
> Willem de Bruijn <willemdebruijn.kernel@gmail.com> wrote:
> > Florian Westphal wrote:
> > > Florian Westphal <fw@strlen.de> wrote:
> > > > ... doesn't solve the nft_hash.c issue (which calls _symmetric version, and
> > > > that uses flow_key definiton that isn't exported outside flow_dissector.o.
> > >
> > > and here is the diff that would pass net for _symmetric, not too
> > > horrible I think.
> > >
> > > With that and the copypaste of skb_get_hash into nf_trace infra
> > > netfilter can still pass skbs to the flow dissector with NULL skb->sk,dev
> > > but the WARN would no longer trigger as struct net is non-null.
> >
> > Thanks for coding this up Florian. This overall looks good to me.
>
> Thanks for reviewing.
>
> > One suggested change is to introduce a three underscore variant (yes
> > really) ___skb_get_hash_symmetric that takes the optional net, and
> > leave the existing callers of the two underscore version as is.
>
> Okay, that reduces the code churn.
>
> > The copypaste probably belongs with the other flow dissector wrappers
> > in sk_buff.h.
>
> skb_get_hash(skb);
> __skb_get_hash_symmetric(skb);
> ____skb_get_hash_symmetric(net, skb);
>
> I named the copypasta as nf_skb_get_hash. If placed in sk_buff.h:
> net_get_hash_net()?
> skb_get_hash()?
Still passing an skb too, so skb_get_hash_net()?
> And if either of that exists, maybe then use
> skb_get_hash_symmetric_net(net, skb)
If symmetric is equally good for nft, that would be preferable, as it
avoids the extra function. But I suppose it aliases the two flow
directions, which may be exactly what you don't want?
> or similar?
>
> (There is no skb_get_hash_symmetric, no idea why it
> uses __prefix).
Perhaps because it is more closely analogous to __skb_get_hash, than
to skb_get_hash.
next prev parent reply other threads:[~2024-06-06 14:28 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-04 12:03 [PATCH nf] netfilter: nf_reject: init skb->dev for reset packet Florian Westphal
[not found] ` <FF8A506F-6F0F-440E-9F52-B27D05731B77@apple.com>
2024-06-05 18:14 ` Florian Westphal
2024-06-05 18:38 ` Pablo Neira Ayuso
2024-06-05 19:08 ` Florian Westphal
2024-06-05 19:45 ` Pablo Neira Ayuso
2024-06-05 21:38 ` Willem de Bruijn
2024-06-05 22:16 ` Pablo Neira Ayuso
2024-06-06 1:54 ` Willem de Bruijn
2024-06-06 6:20 ` Pablo Neira Ayuso
2024-06-06 8:39 ` Florian Westphal
2024-06-06 9:26 ` Florian Westphal
2024-06-06 13:04 ` Florian Westphal
2024-06-06 14:09 ` Willem de Bruijn
2024-06-06 14:15 ` Florian Westphal
2024-06-06 14:28 ` Willem de Bruijn [this message]
2024-06-06 14:38 ` Florian Westphal
2024-06-06 14:43 ` Willem de Bruijn
2024-06-06 14:52 ` Florian Westphal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=6661c788553a4_37c46c294fc@willemb.c.googlers.com.notmuch \
--to=willemdebruijn.kernel@gmail.com \
--cc=cpaasch@apple.com \
--cc=daniel@iogearbox.net \
--cc=fw@strlen.de \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=pablo@netfilter.org \
--cc=willemb@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).