1. 14 6月, 2008 1 次提交
  2. 13 6月, 2008 2 次提交
    • D
      tcp: Revert 'process defer accept as established' changes. · ec0a1966
      David S. Miller 提交于
      This reverts two changesets, ec3c0982
      ("[TCP]: TCP_DEFER_ACCEPT updates - process as established") and
      the follow-on bug fix 9ae27e0a
      ("tcp: Fix slab corruption with ipv6 and tcp6fuzz").
      
      This change causes several problems, first reported by Ingo Molnar
      as a distcc-over-loopback regression where connections were getting
      stuck.
      
      Ilpo Järvinen first spotted the locking problems.  The new function
      added by this code, tcp_defer_accept_check(), only has the
      child socket locked, yet it is modifying state of the parent
      listening socket.
      
      Fixing that is non-trivial at best, because we can't simply just grab
      the parent listening socket lock at this point, because it would
      create an ABBA deadlock.  The normal ordering is parent listening
      socket --> child socket, but this code path would require the
      reverse lock ordering.
      
      Next is a problem noticed by Vitaliy Gusev, he noted:
      
      ----------------------------------------
      >--- a/net/ipv4/tcp_timer.c
      >+++ b/net/ipv4/tcp_timer.c
      >@@ -481,6 +481,11 @@ static void tcp_keepalive_timer (unsigned long data)
      > 		goto death;
      > 	}
      >
      >+	if (tp->defer_tcp_accept.request && sk->sk_state == TCP_ESTABLISHED) {
      >+		tcp_send_active_reset(sk, GFP_ATOMIC);
      >+		goto death;
      
      Here socket sk is not attached to listening socket's request queue. tcp_done()
      will not call inet_csk_destroy_sock() (and tcp_v4_destroy_sock() which should
      release this sk) as socket is not DEAD. Therefore socket sk will be lost for
      freeing.
      ----------------------------------------
      
      Finally, Alexey Kuznetsov argues that there might not even be any
      real value or advantage to these new semantics even if we fix all
      of the bugs:
      
      ----------------------------------------
      Hiding from accept() sockets with only out-of-order data only
      is the only thing which is impossible with old approach. Is this really
      so valuable? My opinion: no, this is nothing but a new loophole
      to consume memory without control.
      ----------------------------------------
      
      So revert this thing for now.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ec0a1966
    • D
      ipv6: Fix duplicate initialization of rawv6_prot.destroy · f23d60de
      David S. Miller 提交于
      In changeset 22dd4850
      ("raw: Raw socket leak.") code was added so that we
      flush pending frames on raw sockets to avoid leaks.
      
      The ipv4 part was fine, but the ipv6 part was not
      done correctly.  Unlike the ipv4 side, the ipv6 code
      already has a .destroy method for rawv6_prot.
      
      So now there were two assignments to this member, and
      what the compiler does is use the last one, effectively
      making the ipv6 parts of that changeset a NOP.
      
      Fix this by removing the:
      
      	.destroy	   = inet6_destroy_sock,
      
      line, and adding an inet6_destroy_sock() call to the
      end of raw6_destroy().
      
      Noticed by Al Viro.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      Acked-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      f23d60de
  3. 12 6月, 2008 7 次提交
  4. 11 6月, 2008 9 次提交
    • G
      dccp: Bug in initial acknowledgment number assignment · be4c798a
      Gerrit Renker 提交于
      Step 8.5 in RFC 4340 says for the newly cloned socket
      
                 Initialize S.GAR := S.ISS,
      
      but what in fact the code (minisocks.c) does is
      
                 Initialize S.GAR := S.ISR,
      
      which is wrong (typo?) -- fixed by the patch.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      be4c798a
    • G
      dccp ccid-3: X truncated due to type conversion · 7deb0f85
      Gerrit Renker 提交于
      This fixes a bug in computing the inter-packet-interval t_ipi = s/X: 
      
       scaled_div32(a, b) uses u32 for b, but in "scaled_div32(s, X)" the type of the
       sending rate `X' is u64. Since X is scaled by 2^6, this truncates rates greater
       than 2^26 Bps (~537 Mbps).
      
      Using full 64-bit division now.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      7deb0f85
    • G
      dccp ccid-3: TFRC reverse-lookup Bug-Fix · 1e8a287c
      Gerrit Renker 提交于
      This fixes a bug in the reverse lookup of p: given a value f(p), instead of p,
      the function returned the smallest tabulated value f(p).
      
      The smallest tabulated value of
      	 
         10^6 * f(p) =  sqrt(2*p/3) + 12 * sqrt(3*p/8) * (32 * p^3 + p) 
      
      for p=0.0001 is 8172. 
      
      Since this value is scaled by 10^6, the outcome of this bug is that a loss
      of 8172/10^6 = 0.8172% was reported whenever the input was below the table
      resolution of 0.01%.
      
      This means that the value was over 80 times too high, resulting in large spikes
      of the initial loss interval, thus unnecessarily reducing the throughput.
      
      Also corrected the printk format (%u for u32).
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      1e8a287c
    • G
      dccp ccid-2: Bug-Fix - Ack Vectors need to be ignored on request sockets · 65907a43
      Gerrit Renker 提交于
      This fixes an oversight from an earlier patch, ensuring that Ack Vectors
      are not processed on request sockets.
      
      The issue is that Ack Vectors must not be parsed on request sockets, since
      the Ack Vector feature depends on the selection of the (TX) CCID. During the
      initial handshake the CCIDs are undefined, and so RFC 4340, 10.3 applies:
      
       "Using CCID-specific options and feature options during a negotiation
        for the corresponding CCID feature is NOT RECOMMENDED [...]"
      
      And it is not even possible: when the server receives the Request from the 
      client, the CCID and Ack vector features are undefined; when the Ack finalising
      the 3-way hanshake arrives, the request socket has not been cloned yet into a
      full socket. (This order is necessary, since otherwise the newly created socket
      would have to be destroyed whenever an option error occurred - a malicious
      hacker could simply send garbage options and exploit this.)
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      65907a43
    • G
      dccp: Fix sparse warnings · 1e2f0e5e
      Gerrit Renker 提交于
      This patch fixes the following sparse warnings:
       * nested min(max()) expression:
         net/dccp/ccids/ccid3.c:91:21: warning: symbol '__x' shadows an earlier one
         net/dccp/ccids/ccid3.c:91:21: warning: symbol '__y' shadows an earlier one
         
       * Declaration of function prototypes in .c instead of .h file, resulting in
         "should it be static?" warnings. 
      
       * Declared "struct dccpw" static (local to dccp_probe).
       
       * Disabled dccp_delayed_ack() - not fully removed due to RFC 4340, 11.3
         ("Receivers SHOULD implement delayed acknowledgement timers ...").
      
       * Used a different local variable name to avoid
         net/dccp/ackvec.c:293:13: warning: symbol 'state' shadows an earlier one
         net/dccp/ackvec.c:238:33: originally declared here
      
       * Removed unused functions `dccp_ackvector_print' and `dccp_ackvec_print'.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      1e2f0e5e
    • G
      dccp ccid-3: Bug-Fix - Zero RTT is possible · 3294f202
      Gerrit Renker 提交于
      In commit $(825de27d) (from 27th May, commit
      message `dccp ccid-3: Fix "t_ipi explosion" bug'), the CCID-3 window counter
      computation was fixed to cope with RTTs < 4 microseconds.
      
      Such RTTs can be found e.g. when running CCID-3 over loopback. The fix removed
      a check against RTT < 4, but introduced a divide-by-zero bug.
      
      All steady-state RTTs in DCCP are filtered using dccp_sample_rtt(), which
      ensures non-zero samples. However, a zero RTT is possible on initialisation,
      when there is no RTT sample from the Request/Response exchange.
      
      The fix is to use the fallback-RTT from RFC 4340, 3.4.
      
      This is also better than just fixing update_win_count() since it allows other
      parts of the code to always assume that the RTT is non-zero during the time
      that the CCID is used.
      Signed-off-by: NGerrit Renker <gerrit@erg.abdn.ac.uk>
      3294f202
    • K
      net: Fix routing tables with id > 255 for legacy software · 709772e6
      Krzysztof Piotr Oledzki 提交于
      Most legacy software do not like tables > 255 as rtm_table is u8
      so tb_id is sent &0xff and it is possible to mismatch for example
      table 510 with table 254 (main).
      
      This patch introduces RT_TABLE_COMPAT=252 so the code uses it if
      tb_id > 255. It makes such old applications happy, new
      ones are still able to use RTA_TABLE to get a proper table id.
      Signed-off-by: NKrzysztof Piotr Oledzki <ole@ans.pl>
      Acked-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      709772e6
    • J
      ipsec: pfkey should ignore events when no listeners · 99c6f60e
      Jamal Hadi Salim 提交于
      When pfkey has no km listeners, it still does a lot of work
      before finding out there aint nobody out there.
      If a tree falls in a forest and no one is around to hear it, does it make
      a sound? In this case it makes a lot of noise:
      With this short-circuit adding 10s of thousands of SAs using
      netlink improves performance by ~10%.
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      99c6f60e
    • A
      inet{6}_request_sock: Init ->opt and ->pktopts in the constructor · ce4a7d0d
      Arnaldo Carvalho de Melo 提交于
      Wei Yongjun noticed that we may call reqsk_free on request sock objects where
      the opt fields may not be initialized, fix it by introducing inet_reqsk_alloc
      where we initialize ->opt to NULL and set ->pktopts to NULL in
      inet6_reqsk_alloc.
      Signed-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ce4a7d0d
  5. 10 6月, 2008 5 次提交
  6. 05 6月, 2008 16 次提交