From: Felipe W Damasio <felipewd@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: David Miller <davem@davemloft.net>,
Patrick McHardy <kaber@trash.net>,
linux-kernel@vger.kernel.org, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets
Date: Sat, 10 Jul 2010 00:18:28 -0300 [thread overview]
Message-ID: <AANLkTil39xHOhcdAo4h_jWtx_UuYdFHGdQVAdwPMd7QJ@mail.gmail.com> (raw)
In-Reply-To: <1278695580.2696.55.camel@edumazet-laptop>
Hi Mr. Dumazet,
2010/7/9 Eric Dumazet <eric.dumazet@gmail.com>:
> Reviewing tproxy stuff I spotted a problem in nf_tproxy_assign_sock()
> but I could not see how it could explain your crash.
>
> We can read uninitialized memory and trigger a fault in
> nf_tproxy_assign_sock(), not later in tcp_recvmsg()...
>
> David, Patrick, what do you think ?
But do you think that the bug that squid triggered was caused by the
TProxy code?
Or is related to the network-stack in some other point.
I don't know if this helps, but I'm using ebtables to remove the
packets from the bridge, and iptables to redirect the traffic to
squid.
ebtables rules are:
-p IPv4 -i eth0 --ip-proto tcp --ip-dport 80 -j redirect --redirect-target DROP
-p IPv4 -i eth1 --ip-proto tcp --ip-sport 80 -j redirect --redirect-target DROP
iptables -t mangle -L -n is:
iptables -t mangle -L -n
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
DIVERT tcp -- 0.0.0.0/0 0.0.0.0/0 socket
extrachain tcp -- 0.0.0.0/0 0.0.0.0/0 tcp
dpt:80 ctstate NEW
TPROXY tcp -- 0.0.0.0/0 !201.40.162.5 tcp
dpt:80 connmark match 0x0 TPROXY redirect 127.0.0.1:3127 mark 0x1/0x1
TPROXY tcp -- 0.0.0.0/0 !201.40.162.5 tcp
dpt:80 connmark match 0x1 TPROXY redirect 127.0.0.1:3128 mark 0x1/0x1
TPROXY tcp -- 0.0.0.0/0 !201.40.162.5 tcp
dpt:80 connmark match 0x2 TPROXY redirect 127.0.0.1:3129 mark 0x1/0x1
Chain DIVERT (1 references)
target prot opt source destination
MARK all -- 0.0.0.0/0 0.0.0.0/0 MARK xset
0x1/0xffffffff
ACCEPT all -- 0.0.0.0/0 0.0.0.0/0
Chain extrachain (1 references)
target prot opt source destination
CONNMARK all -- 0.0.0.0/0 0.0.0.0/0 statistic
mode nth every 35 CONNMARK and 0x0
CONNMARK all -- 0.0.0.0/0 0.0.0.0/0 statistic
mode nth every 35 packet 1 CONNMARK xset 0x1/0xffffffff
CONNMARK all -- 0.0.0.0/0 0.0.0.0/0 statistic
mode nth every 35 packet 2 CONNMARK xset 0x2/0xffffffff
Don't know if the code on these can be traced back to tcp_recvmsg()
accessing some wrong memory address...
Cheers,
Felipe Damasio
next prev parent reply other threads:[~2010-07-10 3:18 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <AANLkTimn8A0cYZmwNZYitRkBHKKFe4HQ5GU626DLugkk@mail.gmail.com>
2010-07-08 22:06 ` Squid hang up on 2.6.34 Eric Dumazet
[not found] ` <AANLkTil49m6Ul2bauiH4Pwn-6ykrYTFmSO6_SxqQgD_e@mail.gmail.com>
2010-07-08 22:08 ` Eric Dumazet
2010-07-09 15:03 ` Felipe W Damasio
2010-07-09 16:03 ` Felipe W Damasio
2010-07-09 17:13 ` [PATCH] tproxy: nf_tproxy_assign_sock() can handle tw sockets Eric Dumazet
2010-07-09 17:53 ` David Miller
2010-07-09 18:16 ` Felipe W Damasio
2010-07-10 3:18 ` Felipe W Damasio [this message]
2010-07-10 6:17 ` Eric Dumazet
2010-07-10 19:30 ` David Miller
2010-07-11 3:11 ` Felipe W Damasio
2010-07-11 7:11 ` Felipe W Damasio
2010-07-11 7:13 ` Felipe W Damasio
2010-07-11 8:36 ` Eric Dumazet
2010-07-11 5:19 ` Avi Kivity
2010-07-11 8:02 ` Eric Dumazet
2010-07-12 0:52 ` Felipe W Damasio
2010-07-12 18:49 ` Felipe W Damasio
2010-07-13 14:24 ` Felipe W Damasio
2010-07-13 14:40 ` Eric Dumazet
2010-07-13 14:49 ` Felipe W Damasio
2010-07-13 15:49 ` Eric Dumazet
2010-07-13 20:55 ` Felipe W Damasio
2010-07-13 21:06 ` Felipe W Damasio
2010-07-14 3:21 ` Eric Dumazet
2010-07-14 3:27 ` Felipe W Damasio
2010-07-14 3:43 ` Eric Dumazet
2010-07-14 3:51 ` Felipe W Damasio
2010-07-14 6:56 ` Bill Fink
2010-07-16 15:41 ` Felipe W Damasio
2010-07-16 15:52 ` Eric Dumazet
2010-07-14 11:41 ` Patrick McHardy
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=AANLkTil39xHOhcdAo4h_jWtx_UuYdFHGdQVAdwPMd7QJ@mail.gmail.com \
--to=felipewd@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=kaber@trash.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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 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).