From: Denys Fedoryshchenko <nuclearcat@nuclearcat.com>
To: Florian Westphal <fw@strlen.de>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
Linux Kernel Network Developers <netdev@vger.kernel.org>,
Pablo Neira Ayuso <pablo@netfilter.org>,
Patrick McHardy <kaber@trash.net>,
Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>,
netfilter-devel@vger.kernel.org, coreteam@netfilter.org,
linux-kernel@vger.kernel.org
Subject: Re: KASAN, xt_TCPMSS finally found nasty use-after-free bug? 4.10.8
Date: Sun, 02 Apr 2017 14:51:25 +0300 [thread overview]
Message-ID: <ddb4ab6cee309a79f4d8e7b8597e5a8f@nuclearcat.com> (raw)
In-Reply-To: <20170402114545.GA31804@breakpoint.cc>
On 2017-04-02 14:45, Florian Westphal wrote:
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
>> - for (i = sizeof(struct tcphdr); i <= tcp_hdrlen - TCPOLEN_MSS; i +=
>> optlen(opt, i)) {
>> + for (i = sizeof(struct tcphdr); i < tcp_hdrlen - TCPOLEN_MSS; i +=
>> optlen(opt, i)) {
>> if (opt[i] == TCPOPT_MSS && opt[i+1] == TCPOLEN_MSS) {
>> u_int16_t oldmss;
>
> maybe I am low on caffeeine but this looks fine, for tcp header with
> only tcpmss this boils down to "20 <= 24 - 4" so we acccess offsets
> 20-23 which seems ok.
It seems some non-standard(or corrupted) packets are passing, because
even on ~1G server it might cause corruption once per several days,
KASAN seems need less time to trigger.
I am not aware how things working, but:
[25181.875696] Memory state around the buggy address:
[25181.875919] ffff8802975fff80: 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00
[25181.876275] ffff880297600000: 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00
[25181.876628] >ffff880297600080: 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00
[25181.876984]
^
[25181.877203] ffff880297600100: 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00
[25181.877569] ffff880297600180: 00 00 00 00 00 00 00 00 00 00 00 00 00
00 00 00
Why all data here is zero? I guess it should be some packet data?
next prev parent reply other threads:[~2017-04-02 11:51 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-02 7:43 KASAN, xt_TCPMSS finally found nasty use-after-free bug? 4.10.8 Denys Fedoryshchenko
2017-04-02 11:24 ` Eric Dumazet
2017-04-02 11:45 ` Florian Westphal
2017-04-02 11:51 ` Denys Fedoryshchenko [this message]
2017-04-02 11:54 ` Eric Dumazet
2017-04-02 12:19 ` Eric Dumazet
2017-04-02 12:25 ` Denys Fedoryshchenko
2017-04-02 12:32 ` Eric Dumazet
2017-04-02 16:52 ` Denys Fedoryshchenko
2017-04-02 17:14 ` Eric Dumazet
2017-04-02 17:26 ` Eric Dumazet
2017-04-03 8:10 ` Denys Fedoryshchenko
2017-04-03 12:09 ` Eric Dumazet
2017-04-03 12:14 ` Denys Fedoryshchenko
2017-04-03 12:24 ` Eric Dumazet
2017-04-03 17:55 ` [PATCH net] netfilter: xt_TCPMSS: add more sanity tests on tcph->doff Eric Dumazet
2017-04-08 20:24 ` Pablo Neira Ayuso
2017-04-20 18:14 ` Denys Fedoryshchenko
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=ddb4ab6cee309a79f4d8e7b8597e5a8f@nuclearcat.com \
--to=nuclearcat@nuclearcat.com \
--cc=coreteam@netfilter.org \
--cc=eric.dumazet@gmail.com \
--cc=fw@strlen.de \
--cc=kaber@trash.net \
--cc=kadlec@blackhole.kfki.hu \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.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 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).