From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Benjamin Hesmans <benjamin.hesmans@tessares.net>
Cc: netfilter-devel@vger.kernel.org,
Matthieu Baerts <matthieu.baerts@tessares.net>
Subject: Re: [PATCH nf] netfilter: socket: icmp6: fix use-after-scope
Date: Fri, 3 Sep 2021 18:24:54 +0200 [thread overview]
Message-ID: <20210903162454.GA13043@salvia> (raw)
In-Reply-To: <20210903132335.25355-1-benjamin.hesmans@tessares.net>
On Fri, Sep 03, 2021 at 03:23:35PM +0200, Benjamin Hesmans wrote:
> Bug reported by KASAN:
>
> BUG: KASAN: use-after-scope in inet6_ehashfn (net/ipv6/inet6_hashtables.c:40)
> Call Trace:
> (...)
> inet6_ehashfn (net/ipv6/inet6_hashtables.c:40)
> (...)
> nf_sk_lookup_slow_v6 (net/ipv6/netfilter/nf_socket_ipv6.c:91
> net/ipv6/netfilter/nf_socket_ipv6.c:146)
>
> It seems that this bug has already been fixed by Eric Dumazet in the
> past in:
> commit 78296c97ca1f ("netfilter: xt_socket: fix a stack corruption bug")
>
> But a variant of the same issue has been introduced in
> commit d64d80a2cde9 ("netfilter: x_tables: don't extract flow keys on early demuxed sks in socket match")
>
> `daddr` and `saddr` potentially hold a reference to ipv6_var that is no
> longer in scope when the call to `nf_socket_get_sock_v6` is made.
Applied, thanks.
prev parent reply other threads:[~2021-09-03 16:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-03 13:23 [PATCH nf] netfilter: socket: icmp6: fix use-after-scope Benjamin Hesmans
2021-09-03 14:00 ` Florian Westphal
2021-09-03 16:24 ` Pablo Neira Ayuso [this message]
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=20210903162454.GA13043@salvia \
--to=pablo@netfilter.org \
--cc=benjamin.hesmans@tessares.net \
--cc=matthieu.baerts@tessares.net \
--cc=netfilter-devel@vger.kernel.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.