public inbox for netdev@vger.kernel.org 
 help / color / mirror / Atom feed
From: Florian Westphal <fw@strlen•de>
To: Florent Revest <revest@chromium•org>
Cc: Florian Westphal <fw@strlen•de>,
	Pablo Neira Ayuso <pablo@netfilter•org>,
	netfilter-devel@vger•kernel.org, coreteam@netfilter•org,
	netdev@vger•kernel.org, linux-kernel@vger•kernel.org,
	bpf@vger•kernel.org, kadlec@netfilter•org, davem@davemloft•net,
	edumazet@google•com, kuba@kernel•org, pabeni@redhat•com,
	lirongqing@baidu•com, daniel@iogearbox•net, ast@kernel•org,
	kpsingh@kernel•org, stable@vger•kernel.org
Subject: Re: [PATCH nf] netfilter: conntrack: Avoid nf_ct_helper_hash uses after free
Date: Wed, 21 Jun 2023 20:47:38 +0200	[thread overview]
Message-ID: <20230621184738.GG24035@breakpoint.cc> (raw)
In-Reply-To: <CABRcYmKeo6A+3dmZd9bRp8W3tO9M5cHDpQ13b8aeMkhYr4L64Q@mail.gmail.com>

Florent Revest <revest@chromium•org> wrote:
> > in this case an initcall is failing and I think panic is preferrable
> > to a kernel that behaves like NF_CONNTRACK_FTP=n.
> 
> In that case, it seems like what you'd want is
> nf_conntrack_standalone_init() to BUG() instead of returning an error
> then ? (so you'd never get to NF_CONNTRACK_FTP or any other if
> nf_conntrack failed to initialize) If this is the prefered behavior,
> then sure, why not.
> 
> > AFAICS this problem is specific to NF_CONNTRACK_FTP=y
> > (or any other helper module, for that matter).
> 
> Even with NF_CONNTRACK_FTP=m, the initialization failure in
> nf_conntrack_standalone_init() still happens. Therefore, the helper
> hashtable gets freed and when the nf_conntrack_ftp.ko module gets
> insmod-ed, it calls nf_conntrack_helpers_register() and this still
> causes a use-after-free.

Can you send a v2 with a slightly reworded changelog?

It should mention that one needs NF_CONNTRACK=y, so that when
the failure happens during the initcall (as oposed to module insertion),
nf_conntrack_helpers_register() can fail cleanly without followup splat?

Thanks.

  reply	other threads:[~2023-06-21 18:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-15 15:29 [PATCH nf] netfilter: conntrack: Avoid nf_ct_helper_hash uses after free Florent Revest
2023-06-20  6:35 ` Pablo Neira Ayuso
2023-06-21 10:20   ` Florent Revest
2023-06-21 11:12     ` Pablo Neira Ayuso
2023-06-21 12:41       ` Florent Revest
2023-06-21 11:14     ` Florian Westphal
2023-06-21 13:07       ` Florent Revest
2023-06-21 18:47         ` Florian Westphal [this message]
2023-07-03 14:42           ` Florent Revest

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=20230621184738.GG24035@breakpoint.cc \
    --to=fw@strlen$(echo .)de \
    --cc=ast@kernel$(echo .)org \
    --cc=bpf@vger$(echo .)kernel.org \
    --cc=coreteam@netfilter$(echo .)org \
    --cc=daniel@iogearbox$(echo .)net \
    --cc=davem@davemloft$(echo .)net \
    --cc=edumazet@google$(echo .)com \
    --cc=kadlec@netfilter$(echo .)org \
    --cc=kpsingh@kernel$(echo .)org \
    --cc=kuba@kernel$(echo .)org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=lirongqing@baidu$(echo .)com \
    --cc=netdev@vger$(echo .)kernel.org \
    --cc=netfilter-devel@vger$(echo .)kernel.org \
    --cc=pabeni@redhat$(echo .)com \
    --cc=pablo@netfilter$(echo .)org \
    --cc=revest@chromium$(echo .)org \
    --cc=stable@vger$(echo .)kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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