1. 12 6月, 2008 1 次提交
  2. 11 6月, 2008 1 次提交
  3. 10 6月, 2008 4 次提交
  4. 05 6月, 2008 7 次提交
    • O
      tcp: Fix for race due to temporary drop of the socket lock in skb_splice_bits. · 293ad604
      Octavian Purdila 提交于
      skb_splice_bits temporary drops the socket lock while iterating over
      the socket queue in order to break a reverse locking condition which
      happens with sendfile. This, however, opens a window of opportunity
      for tcp_collapse() to aggregate skbs and thus potentially free the
      current skb used in skb_splice_bits and tcp_read_sock.
      
      This patch fixes the problem by (re-)getting the same "logical skb"
      after the lock has been temporary dropped.
      
      Based on idea and initial patch from Evgeniy Polyakov.
      Signed-off-by: NOctavian Purdila <opurdila@ixiacom.com>
      Acked-by: NEvgeniy Polyakov <johnpol@2ka.mipt.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      293ad604
    • S
      tcp: Increment OUTRSTS in tcp_send_active_reset() · 26af65cb
      Sridhar Samudrala 提交于
      TCP "resets sent" counter is not incremented when a TCP Reset is 
      sent via tcp_send_active_reset().
      Signed-off-by: NSridhar Samudrala <sri@us.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      26af65cb
    • D
      raw: Raw socket leak. · 22dd4850
      Denis V. Lunev 提交于
      The program below just leaks the raw kernel socket
      
      int main() {
              int fd = socket(PF_INET, SOCK_RAW, IPPROTO_UDP);
              struct sockaddr_in addr;
      
              memset(&addr, 0, sizeof(addr));
              inet_aton("127.0.0.1", &addr.sin_addr);
              addr.sin_family = AF_INET;
              addr.sin_port = htons(2048);
              sendto(fd,  "a", 1, MSG_MORE, &addr, sizeof(addr));
              return 0;
      }
      
      Corked packet is allocated via sock_wmalloc which holds the owner socket,
      so one should uncork it and flush all pending data on close. Do this in the
      same way as in UDP.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Acked-by: NAlexey Kuznetsov <kuznet@ms2.inr.ac.ru>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      22dd4850
    • I
      tcp: fix skb vs fack_count out-of-sync condition · a6604471
      Ilpo Järvinen 提交于
      This bug is able to corrupt fackets_out in very rare cases.
      In order for this to cause corruption:
        1) DSACK in the middle of previous SACK block must be generated.
        2) In order to take that particular branch, part or all of the
           DSACKed segment must already be SACKed so that we have that
           in cache in the first place.
        3) The new info must be top enough so that fackets_out will be
           updated on this iteration.
      ...then fack_count is updated while skb wasn't, then we walk again
      that particular segment thus updating fack_count twice for
      a single skb and finally that value is assigned to fackets_out
      by tcp_sacktag_one.
      
      It is safe to call tcp_sacktag_one just once for a segment (at
      DSACK), no need to call again for plain SACK.
      
      Potential problem of the miscount are limited to premature entry
      to recovery and to inflated reordering metric (which could even
      cancel each other out in the most the luckiest scenarios :-)).
      Both are quite insignificant in worst case too and there exists
      also code to reset them (fackets_out once sacked_out becomes zero
      and reordering metric on RTO).
      
      This has been reported by a number of people, because it occurred
      quite rarely, it has been very evasive. Andy Furniss was able to
      get it to occur couple of times so that a bit more info was
      collected about the problem using a debug patch, though it still
      required lot of checking around. Thanks also to others who have
      tried to help here.
      
      This is listed as Bugzilla #10346. The bug was introduced by
      me in commit 68f8353b ([TCP]: Rewrite SACK block processing & 
      sack_recv_cache use), I probably thought back then that there's
      need to scan that entry twice or didn't dare to make it go
      through it just once there. Going through twice would have
      required restoring fack_count after the walk but as noted above,
      I chose to drop the additional walk step altogether here.
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a6604471
    • D
      [IPV6]: inet_sk(sk)->cork.opt leak · 36d926b9
      Denis V. Lunev 提交于
      IPv6 UDP sockets wth IPv4 mapped address use udp_sendmsg to send the data
      actually. In this case ip_flush_pending_frames should be called instead
      of ip6_flush_pending_frames.
      Signed-off-by: NDenis V. Lunev <den@openvz.org>
      Signed-off-by: NYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>
      36d926b9
    • Y
    • I
      tcp: Fix inconsistency source (CA_Open only when !tcp_left_out(tp)) · 8aca6cb1
      Ilpo Järvinen 提交于
      It is possible that this skip path causes TCP to end up into an
      invalid state where ca_state was left to CA_Open while some
      segments already came into sacked_out. If next valid ACK doesn't
      contain new SACK information TCP fails to enter into
      tcp_fastretrans_alert(). Thus at least high_seq is set
      incorrectly to a too high seqno because some new data segments
      could be sent in between (and also, limited transmit is not
      being correctly invoked there). Reordering in both directions
      can easily cause this situation to occur.
      
      I guess we would want to use tcp_moderate_cwnd(tp) there as well
      as it may be possible to use this to trigger oversized burst to
      network by sending an old ACK with huge amount of SACK info, but
      I'm a bit unsure about its effects (mainly to FlightSize), so to
      be on the safe side I just currently fixed it minimally to keep
      TCP's state consistent (obviously, such nasty ACKs have been
      possible this far). Though it seems that FlightSize is already
      underestimated by some amount, so probably on the long term we
      might want to trigger recovery there too, if appropriate, to make
      FlightSize calculation to resemble reality at the time when the
      losses where discovered (but such change scares me too much now
      and requires some more thinking anyway how to do that as it
      likely involves some code shuffling).
      
      This bug was found by Brian Vowell while running my TCP debug
      patch to find cause of another TCP issue (fackets_out
      miscount).
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      8aca6cb1
  5. 04 6月, 2008 3 次提交
  6. 22 5月, 2008 7 次提交
  7. 21 5月, 2008 1 次提交
    • H
      ipsec: Use the correct ip_local_out function · 1ac06e03
      Herbert Xu 提交于
      Because the IPsec output function xfrm_output_resume does its
      own dst_output call it should always call __ip_local_output
      instead of ip_local_output as the latter may invoke dst_output
      directly.  Otherwise the return values from nf_hook and dst_output
      may clash as they both use the value 1 but for different purposes.
      
      When that clash occurs this can cause a packet to be used after
      it has been freed which usually leads to a crash.  Because the
      offending value is only returned from dst_output with qdiscs
      such as HTB, this bug is normally not visible.
      
      Thanks to Marco Berizzi for his perseverance in tracking this
      down.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      1ac06e03
  8. 20 5月, 2008 2 次提交
  9. 14 5月, 2008 1 次提交
  10. 13 5月, 2008 3 次提交
    • I
      tcp FRTO: work-around inorder receivers · 79d44516
      Ilpo Järvinen 提交于
      If receiver consumes segments successfully only in-order, FRTO
      fallback to conventional recovery produces RTO loop because
      FRTO's forward transmissions will always get dropped and need to
      be resent, yet by default they're not marked as lost (which are
      the only segments we will retransmit in CA_Loss).
      
      Price to pay about this is occassionally unnecessarily
      retransmitting the forward transmission(s). SACK blocks help
      a bit to avoid this, so it's mainly a concern for NewReno case
      though SACK is not fully immune either.
      
      This change has a side-effect of fixing SACKFRTO problem where
      it didn't have snd_nxt of the RTO time available anymore when
      fallback become necessary (this problem would have only occured
      when RTO would occur for two or more segments and ECE arrives
      in step 3; no need to figure out how to fix that unless the
      TODO item of selective behavior is considered in future).
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Reported-by: NDamon L. Chesser <damon@damtek.com>
      Tested-by: NDamon L. Chesser <damon@damtek.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      79d44516
    • I
      tcp FRTO: Fix fallback to conventional recovery · a1c1f281
      Ilpo Järvinen 提交于
      It seems that commit 009a2e3e ("[TCP] FRTO: Improve
      interoperability with other undo_marker users") run into
      another land-mine which caused fallback to conventional
      recovery to break:
      
      1. Cumulative ACK arrives after FRTO retransmission
      2. tcp_try_to_open sees zero retrans_out, clears retrans_stamp
         which should be kept like in CA_Loss state it would be
      3. undo_marker change allowed tcp_packet_delayed to return
         true because of the cleared retrans_stamp once FRTO is
         terminated causing LossUndo to occur, which means all loss
         markings FRTO made are reverted.
      
      This means that the conventional recovery basically recovered
      one loss per RTT, which is not that efficient. It was quite
      unobvious that the undo_marker change broken something like
      this, I had a quite long session to track it down because of
      the non-intuitiviness of the bug (luckily I had a trivial
      reproducer at hand and I was also able to learn to use kprobes
      in the process as well :-)).
      
      This together with the NewReno+FRTO fix and FRTO in-order
      workaround this fixes Damon's problems, this and the first
      mentioned are enough to fix Bugzilla #10063.
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Reported-by: NDamon L. Chesser <damon@damtek.com>
      Tested-by: NDamon L. Chesser <damon@damtek.com>
      Tested-by: NSebastian Hyrwall <zibbe@cisko.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a1c1f281
    • J
      net: Allow netdevices to specify needed head/tailroom · f5184d26
      Johannes Berg 提交于
      This patch adds needed_headroom/needed_tailroom members to struct
      net_device and updates many places that allocate sbks to use them. Not
      all of them can be converted though, and I'm sure I missed some (I
      mostly grepped for LL_RESERVED_SPACE)
      Signed-off-by: NJohannes Berg <johannes@sipsolutions.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f5184d26
  11. 08 5月, 2008 2 次提交
    • J
      net/ipv4: correct RFC 1122 section reference in comment · c67fa027
      J.H.M. Dassen (Ray) 提交于
      RFC 1122 does not have a section 3.1.2.2. The requirement to silently
      discard datagrams with a bad checksum is in section 3.2.1.2 instead.
      
      Addresses http://bugzilla.kernel.org/show_bug.cgi?id=10611Signed-off-by: NJ.H.M. Dassen (Ray) <jdassen@debian.org>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c67fa027
    • I
      tcp FRTO: SACK variant is errorneously used with NewReno · 62ab2227
      Ilpo Järvinen 提交于
      Note: there's actually another bug in FRTO's SACK variant, which
      is the causing failure in NewReno case because of the error
      that's fixed here. I'll fix the SACK case separately (it's
      a separate bug really, though related, but in order to fix that
      I need to audit tp->snd_nxt usage a bit).
      
      There were two places where SACK variant of FRTO is getting
      incorrectly used even if SACK wasn't negotiated by the TCP flow.
      This leads to incorrect setting of frto_highmark with NewReno
      if a previous recovery was interrupted by another RTO.
      
      An eventual fallback to conventional recovery then incorrectly
      considers one or couple of segments as forward transmissions
      though they weren't, which then are not LOST marked during
      fallback making them "non-retransmittable" until the next RTO.
      In a bad case, those segments are really lost and are the only
      one left in the window. Thus TCP needs another RTO to continue.
      The next FRTO, however, could again repeat the same events
      making the progress of the TCP flow extremely slow.
      
      In order for these events to occur at all, FRTO must occur
      again in FRTOs step 3 while the key segments must be lost as
      well, which is not too likely in practice. It seems to most
      frequently with some small devices such as network printers
      that *seem* to accept TCP segments only in-order. In cases
      were key segments weren't lost, things get automatically
      resolved because those wrongly marked segments don't need to be
      retransmitted in order to continue.
      
      I found a reproducer after digging up relevant reports (few
      reports in total, none at netdev or lkml I know of), some
      cases seemed to indicate middlebox issues which seems now
      to be a false assumption some people had made. Bugzilla
      #10063 _might_ be related. Damon L. Chesser <damon@damtek.com>
      had a reproducable case and was kind enough to tcpdump it
      for me. With the tcpdump log it was quite trivial to figure
      out.
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      62ab2227
  12. 05 5月, 2008 2 次提交
  13. 03 5月, 2008 1 次提交
  14. 02 5月, 2008 2 次提交
  15. 01 5月, 2008 2 次提交
    • R
      rename div64_64 to div64_u64 · 6f6d6a1a
      Roman Zippel 提交于
      Rename div64_64 to div64_u64 to make it consistent with the other divide
      functions, so it clearly includes the type of the divide.  Move its definition
      to math64.h as currently no architecture overrides the generic implementation.
       They can still override it of course, but the duplicated declarations are
      avoided.
      Signed-off-by: NRoman Zippel <zippel@linux-m68k.org>
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Russell King <rmk@arm.linux.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Ralf Baechle <ralf@linux-mips.org>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Patrick McHardy <kaber@trash.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      6f6d6a1a
    • H
      net: fix returning void-valued expression warnings · ab59859d
      Harvey Harrison 提交于
      drivers/net/8390.c:37:2: warning: returning void-valued expression
      drivers/net/bnx2.c:1635:3: warning: returning void-valued expression
      drivers/net/xen-netfront.c:1806:2: warning: returning void-valued expression
      net/ipv4/tcp_hybla.c:105:3: warning: returning void-valued expression
      net/ipv4/tcp_vegas.c:171:3: warning: returning void-valued expression
      net/ipv4/tcp_veno.c:123:3: warning: returning void-valued expression
      net/sysctl_net.c:85:2: warning: returning void-valued expression
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Acked-by: NAlan Cox <alan@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ab59859d
  16. 30 4月, 2008 1 次提交
    • L
      tcp: Overflow bug in Vegas · 15913114
      Lachlan Andrew 提交于
      From: Lachlan Andrew <lachlan.andrew@gmail.com>
      
      There is an overflow bug in net/ipv4/tcp_vegas.c for large BDPs
      (e.g. 400Mbit/s, 400ms).  The multiplication (old_wnd *
      vegas->baseRTT) << V_PARAM_SHIFT overflows a u32.
      
      [ Fix tcp_veno.c too, it has similar calculations. -DaveM ]
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      15913114