public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Shawn Lu <shawn.lu@ericsson.com>
Cc: "davem@davemloft.net" <davem@davemloft.net>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"xiaoclu@gmail.com" <xiaoclu@gmail.com>
Subject: RE: [PATCH] tcp: md5: fix md5 RST when both sides have listener
Date: Tue, 31 Jan 2012 14:33:48 +0100	[thread overview]
Message-ID: <1328016828.2297.8.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC> (raw)
In-Reply-To: <1328000712.2422.16.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC>

Le mardi 31 janvier 2012 à 10:05 +0100, Eric Dumazet a écrit :

> Hmm... The second problem is that its not safe to call
> tcp_v4_md5_do_lookup() on an unlocked socket.
> 
> And locking a listener is way too expensive, since a listener socket is
> already a contention point.
> 
> An attacker could send forged tcp md5 packets to slow down a server.
> 
> A proper patch needs RCU conversion first.

I am working on this RCU conversion and big md5 cleanup, using a single
list of keys.

You can then add your fix on top of this work.


union tcp_md5_addr {
        struct in_addr  a4;
#if IS_ENABLED(CONFIG_IPV6)
        struct in6_addr a6;
#endif
};

/* - key database */
struct tcp_md5sig_key {
        struct hlist_node       node;
        u8                      keylen;
        u8                      family; /* AF_INET or AF_INET6 */
        union tcp_md5_addr      addr;
        u8                      key[TCP_MD5SIG_MAXKEYLEN];
        struct rcu_head         rcu;
};

/* - sock block */
struct tcp_md5sig_info {
        struct hlist_head       head;
};

  reply	other threads:[~2012-01-31 13:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-31  2:07 [PATCH] tcp: md5: fix md5 RST when both sides have listener Shawn Lu
2012-01-31  2:16 ` Eric Dumazet
2012-01-31  2:37   ` Shawn Lu
2012-01-31  8:39   ` Shawn Lu
2012-01-31  9:05     ` Eric Dumazet
2012-01-31 13:33       ` Eric Dumazet [this message]
2012-01-31 15:18         ` [PATCH net-next] tcp: md5: rcu conversion Eric Dumazet
2012-01-31 15:38           ` Eric Dumazet
2012-01-31 17:15             ` David Miller
2012-01-31 20:56               ` [PATCH net-next] tcp: md5: use sock_kmalloc() to limit md5 keys Eric Dumazet
2012-01-31 21:13                 ` David Miller
2012-01-31 17:14           ` [PATCH net-next] tcp: md5: rcu conversion David Miller
2012-01-31 18:15         ` [PATCH] tcp: md5: fix md5 RST when both sides have listener Shawn Lu
     [not found] <RE: [PATCH] tcp: md5: fix md5 RST when both sides have listener>
2012-01-31 23:53 ` Shawn Lu
2012-02-01  5:09   ` Eric Dumazet
2012-02-01  7:48     ` Shawn Lu
2012-02-01  7:53       ` Eric Dumazet
2012-02-01  8:11         ` Shawn Lu
2012-02-01  9:25           ` Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2012-02-01  0:50 (unknown), Shawn Lu
2012-02-01  0:50 ` [PATCH] tcp: md5: fix md5 RST when both sides have listener Shawn Lu
2012-02-01  4:08   ` Eric Dumazet

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=1328016828.2297.8.camel@edumazet-HP-Compaq-6005-Pro-SFF-PC \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shawn.lu@ericsson.com \
    --cc=xiaoclu@gmail.com \
    /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