1. 29 1月, 2008 5 次提交
    • H
      [NET] CORE: Introducing new memory accounting interface. · 3ab224be
      Hideo Aoki 提交于
      This patch introduces new memory accounting functions for each network
      protocol. Most of them are renamed from memory accounting functions
      for stream protocols. At the same time, some stream memory accounting
      functions are removed since other functions do same thing.
      
      Renaming:
      	sk_stream_free_skb()		->	sk_wmem_free_skb()
      	__sk_stream_mem_reclaim()	->	__sk_mem_reclaim()
      	sk_stream_mem_reclaim()		->	sk_mem_reclaim()
      	sk_stream_mem_schedule 		->    	__sk_mem_schedule()
      	sk_stream_pages()      		->	sk_mem_pages()
      	sk_stream_rmem_schedule()	->	sk_rmem_schedule()
      	sk_stream_wmem_schedule()	->	sk_wmem_schedule()
      	sk_charge_skb()			->	sk_mem_charge()
      
      Removeing
      	sk_stream_rfree():	consolidates into sock_rfree()
      	sk_stream_set_owner_r(): consolidates into skb_set_owner_r()
      	sk_stream_mem_schedule()
      
      The following functions are added.
          	sk_has_account(): check if the protocol supports accounting
      	sk_mem_uncharge(): do the opposite of sk_mem_charge()
      
      In addition, to achieve consolidation, updating sk_wmem_queued is
      removed from sk_mem_charge().
      
      Next, to consolidate memory accounting functions, this patch adds
      memory accounting calls to network core functions. Moreover, present
      memory accounting call is renamed to new accounting call.
      
      Finally we replace present memory accounting calls with new interface
      in TCP and SCTP.
      Signed-off-by: NTakahiro Yasui <tyasui@redhat.com>
      Signed-off-by: NHideo Aoki <haoki@redhat.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      3ab224be
    • V
      [SCTP]: Follow Add-IP security consideratiosn wrt INIT/INIT-ACK · d6701191
      Vlad Yasevich 提交于
      The Security Considerations section of RFC 5061 has the following
      text:
      
         If an SCTP endpoint that supports this extension receives an INIT
         that indicates that the peer supports the ASCONF extension but does
         NOT support the [RFC4895] extension, the receiver of such an INIT
         MUST send an ABORT in response.  Note that an implementation is
         allowed to silently discard such an INIT as an option as well, but
         under NO circumstance is an implementation allowed to proceed with
         the association setup by sending an INIT-ACK in response.
      
         An implementation that receives an INIT-ACK that indicates that the
         peer does not support the [RFC4895] extension MUST NOT send the
         COOKIE-ECHO to establish the association.  Instead, the
         implementation MUST discard the INIT-ACK and report to the upper-
         layer user that an association cannot be established destroying the
         Transmission Control Block (TCB).
      
      Follow the recomendations.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d6701191
    • V
      [SCTP]: Implement ADD-IP special case processing for ABORT chunk · 75205f47
      Vlad Yasevich 提交于
      ADD-IP spec has a special case for processing ABORTs:
          F4) ... One special consideration is that ABORT
              Chunks arriving destined to the IP address being deleted MUST be
              ignored (see Section 5.3.1 for further details).
      
      Check if the address we received on is in the DEL state, and if
      so, ignore the ABORT.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      75205f47
    • V
      [SCTP]: Update ASCONF processing to conform to spec. · a08de64d
      Vlad Yasevich 提交于
      The processing of the ASCONF chunks has changed a lot in the
      spec.  New items are:
          1. A list of ASCONF-ACK chunks is now cached
          2. The source of the packet is used in response.
          3. New handling for unexpect ASCONF chunks.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      a08de64d
    • V
      [SCTP]: Discard unauthenticated ASCONF and ASCONF ACK chunks · 6afd2e83
      Vlad Yasevich 提交于
      Now that we support AUTH, discard unauthenticated ASCONF and ASCONF ACK
      chunks as mandated in the ADD-IP spec.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6afd2e83
  2. 09 1月, 2008 1 次提交
  3. 29 11月, 2007 1 次提交
  4. 20 11月, 2007 1 次提交
  5. 12 11月, 2007 1 次提交
    • J
      Fix memory leak in discard case of sctp_sf_abort_violation() · 9abed245
      Jesper Juhl 提交于
      In net/sctp/sm_statefuns.c::sctp_sf_abort_violation() we may leak
      the storage allocated for 'abort' by returning from the function
      without using or freeing it. This happens in case
      "sctp_auth_recv_cid(SCTP_CID_ABORT, asoc)" is true and we jump to
      the 'discard' label.
      Spotted by the Coverity checker.
      
      The simple fix is to simply move the creation of the "abort chunk"
      to after the possible jump to the 'discard' label. This way we don't
      even have to allocate the memory at all in the problem case.
      Signed-off-by: NJesper Juhl <jesper.juhl@gmail.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      9abed245
  6. 08 11月, 2007 1 次提交
    • V
      SCTP: Fix difference cases of retransmit. · b6157d8e
      Vlad Yasevich 提交于
      Commit d0ce9291 broke several retransmit
      cases including fast retransmit.  The reason is that we should
      only delay by rto while doing retranmists as a result of a timeout.
      Retransmit as a result of path mtu discover, fast retransmit, or
      other evernts that should trigger immidiate retransmissions got broken.
      
      Also, since rto is doubled prior to marking of packets elegable for
      retransmission, we never marked correct chunks anyway.
      
      The fix is provide a reason for a given retransmission so that we
      can mark chunks appropriately and to save the old rto value to do
      comparisons against.
      
      All regressions tests passed with this code.
      
      Spotted by Wei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      b6157d8e
  7. 11 10月, 2007 4 次提交
  8. 26 9月, 2007 4 次提交
  9. 31 8月, 2007 3 次提交
    • V
      SCTP: Abort on COOKIE-ECHO if backlog is exceeded. · 609ee467
      Vlad Yasevich 提交于
      Currently we abort on the INIT chunk we our backlog is currenlty
      exceeded.  Delay this about untill COOKIE-ECHO to give the user
      time to accept the socket.  Also, make sure that we treat
      sk_max_backlog of 0 as no connections allowed.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      609ee467
    • W
      SCTP: Use net_ratelimit to suppress error messages print too fast · d99fa429
      Wei Yongjun 提交于
      When multi bundling SHUTDOWN-ACK message is received in ESTAB state,
      this will cause "sctp protocol violation state" message print many times.
      If SHUTDOWN-ACK is bundled 300 times in one packet, message will be
      print 300 times. The same problem also exists when received unexpected
      HEARTBEAT-ACK message which is bundled message times.
      
      This patch used net_ratelimit() to suppress error messages print too fast.
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      d99fa429
    • W
      SCTP: Fix to encode PROTOCOL VIOLATION error cause correctly · 00f1c2df
      Wei Yongjun 提交于
      PROTOCOL VIOLATION error cause in ABORT is bad encode when make abort
      chunk. When SCTP encode ABORT chunk with PROTOCOL VIOLATION error cause,
      it just add the error messages to PROTOCOL VIOLATION error cause, the
      rest four bytes(struct sctp_paramhdr) is just add to the chunk, not
      change the length of error cause. This cause the ABORT chunk to be a bad
      format. The chunk is like this:
      
      ABORT chunk
        Chunk type: ABORT (6)
        Chunk flags: 0x00
        Chunk length: 72 (*1)
        Protocol violation cause
          Cause code: Protocol violation (0x000d)
          Cause length: 62 (*2)
          Cause information: 5468652063756D756C61746976652074736E2061636B2062...
          Cause padding: 0000
      [Needless] 00030010
      Chunk Length(*1) = 72 but Cause length(*2) only 62, not include the
      extend 4 bytes.
      ((72 - sizeof(chunk_hdr)) = 68) != (62 +3) / 4 * 4
      Signed-off-by: NWei Yongjun <yjwei@cn.fujitsu.com>
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      00f1c2df
  10. 02 8月, 2007 1 次提交
  11. 19 7月, 2007 1 次提交
  12. 05 5月, 2007 1 次提交
    • V
      [SCTP]: Set assoc_id correctly during INIT collision. · 07d93967
      Vlad Yasevich 提交于
      During the INIT/COOKIE-ACK collision cases, it's possible to get
      into a situation where the association id is not yet set at the time
      of the user event generation.  As a result, user events have an
      association id set to 0 which will confuse applications.
      
      This happens if we hit case B of duplicate cookie processing.
      In the particular example found and provided by Oscar Isaula
      <Oscar.Isaula@motorola.com>, flow looks like this:
      A				B
      ---- INIT------->  (lost)
      	    <---------INIT------
      ---- INIT-ACK--->
      	    <------ Cookie ECHO
      
      When the Cookie Echo is received, we end up trying to update the
      association that was created on A as a result of the (lost) INIT,
      but that association doesn't have the ID set yet.
      Signed-off-by: NVlad Yasevich <vladislav.yasevich@hp.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      07d93967
  13. 26 4月, 2007 4 次提交
  14. 20 3月, 2007 1 次提交
  15. 27 2月, 2007 1 次提交
  16. 11 2月, 2007 1 次提交
  17. 24 1月, 2007 3 次提交
  18. 23 12月, 2006 1 次提交
  19. 03 12月, 2006 5 次提交