[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4D594F9E.2090100@trash.net>
Date: Mon, 14 Feb 2011 16:51:58 +0100
From: Patrick McHardy <kaber@...sh.net>
To: Florian Westphal <fw@...len.de>
CC: netfilter-devel@...r.kernel.org, netdev@...r.kernel.org,
Balazs Scheidler <bazsi@...abit.hu>,
KOVACS Krisztian <hidden@...abit.hu>
Subject: Re: [PATCH 1/1] tproxy: do not assign timewait sockets to skb->sk
Am 14.02.2011 12:44, schrieb Florian Westphal:
> Assigning a socket in timewait state to skb->sk can trigger
> kernel oops, e.g. in nfnetlink_log, which does:
>
> if (skb->sk) {
> read_lock_bh(&skb->sk->sk_callback_lock);
> if (skb->sk->sk_socket && skb->sk->sk_socket->file) ...
>
> in the timewait case, accessing sk->sk_callback_lock and sk->sk_socket
> is invalid.
>
> Either all of these spots will need to add a test for sk->sk_state != TCP_TIME_WAIT,
> or xt_TPROXY must not assign a timewait socket to skb->sk.
>
> This does the latter.
>
> If a TW socket is found, assign the tproxy nfmark, but skip the skb->sk assignment,
> thus mimicking behaviour of a '-m socket .. -j MARK/ACCEPT' re-routing rule.
>
> The 'SYN to TW socket' case is left unchanged -- we try to redirect to the
> listener socket.
>
> Cc: Balazs Scheidler <bazsi@...abit.hu>
> Cc: KOVACS Krisztian <hidden@...abit.hu>
> Signed-off-by: Florian Westphal <fwestphal@...aro.com>
Looks fine to me. Balazs. Krisztian, any objections?
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists