From: Paolo Abeni <pabeni@redhat.com>
To: Chengen Du <chengen.du@canonical.com>,
Michal Kubiak <michal.kubiak@intel.com>
Cc: Florian Westphal <fw@strlen.de>,
jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us,
davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
ozsh@nvidia.com, paulb@nvidia.com, marcelo.leitner@gmail.com,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
Gerald Yang <gerald.yang@canonical.com>
Subject: Re: [PATCH net v2] net/sched: Fix UAF when resolving a clash
Date: Tue, 09 Jul 2024 12:40:22 +0200 [thread overview]
Message-ID: <16e61611ecc9209bdf7de68f77804793386850dd.camel@redhat.com> (raw)
In-Reply-To: <CAPza5qc0J7QaEjxJBW=AyHOpiSUN9nkhOor_K2dMcpC_kg0cPg@mail.gmail.com>
On Mon, 2024-07-08 at 17:39 +0800, Chengen Du wrote:
> On Mon, Jul 8, 2024 at 4:33 PM Michal Kubiak <michal.kubiak@intel.com> wrote:
> > For example, if "nf_conntrack_confirm()" returns NF_ACCEPT, (even after
> > the clash resolving), I would not expect calling "goto drop".
> > That is why I suggested a less invasive solution which is just blocking
> > calling "tcf_ct_flow_table_process_conn()" where there is a risk of UAF.
> > So, I asked if such solution would work in case of this function.
>
> Thank you for expressing your concerns in detail.
>
> In my humble opinion, skipping the addition of an entry in the flow
> table is controlled by other logic and may not be suitable to mix with
> error handling. If nf_conntrack_confirm returns NF_ACCEPT, I believe
> there is no reason for nf_ct_get to fail. The nf_ct_get function
> simply converts skb->_nfct into a struct nf_conn type. The only
> instance it might fail is when CONFIG_NF_CONNTRACK is disabled. The
> CONFIG_NET_ACT_CT depends on this configuration and determines whether
> act_ct.c needs to be compiled. Actually, the "goto drop" logic is
> included for completeness and might only be relevant if the memory is
> corrupted. Perhaps we could wrap the judgment with "unlikely" to
> emphasize this point?
I agree with Michal, I think it should be better to just skip
tcf_ct_flow_table_process_conn() in case of clash to avoid potential
behavior changes.
Thanks,
Paolo
next prev parent reply other threads:[~2024-07-09 10:40 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-05 2:50 [PATCH net v2] net/sched: Fix UAF when resolving a clash Chengen Du
2024-07-05 8:21 ` Michal Kubiak
2024-07-05 9:35 ` Florian Westphal
2024-07-06 1:42 ` Chengen Du
2024-07-08 8:33 ` Michal Kubiak
2024-07-08 9:39 ` Chengen Du
2024-07-09 10:40 ` Paolo Abeni [this message]
2024-07-10 5:15 ` Chengen Du
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=16e61611ecc9209bdf7de68f77804793386850dd.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=chengen.du@canonical.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=fw@strlen.de \
--cc=gerald.yang@canonical.com \
--cc=jhs@mojatatu.com \
--cc=jiri@resnulli.us \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo.leitner@gmail.com \
--cc=michal.kubiak@intel.com \
--cc=netdev@vger.kernel.org \
--cc=ozsh@nvidia.com \
--cc=paulb@nvidia.com \
--cc=xiyou.wangcong@gmail.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).