1. 26 11月, 2008 17 次提交
  2. 31 10月, 2008 1 次提交
  3. 30 10月, 2008 1 次提交
  4. 29 10月, 2008 1 次提交
  5. 06 10月, 2008 1 次提交
  6. 01 10月, 2008 1 次提交
    • H
      ipsec: Put dumpers on the dump list · 12a169e7
      Herbert Xu 提交于
      Herbert Xu came up with the idea and the original patch to make
      xfrm_state dump list contain also dumpers:
      
      As it is we go to extraordinary lengths to ensure that states
      don't go away while dumpers go to sleep.  It's much easier if
      we just put the dumpers themselves on the list since they can't
      go away while they're going.
      
      I've also changed the order of addition on new states to prevent
      a never-ending dump.
      
      Timo Teräs improved the patch to apply cleanly to latest tree,
      modified iteration code to be more readable by using a common
      struct for entries in the list, implemented the same idea for
      xfrm_policy dumping and moved the af_key specific "last" entry
      caching to af_key.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NTimo Teras <timo.teras@iki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      12a169e7
  7. 23 9月, 2008 1 次提交
    • H
      ipsec: Fix xfrm_state_walk race · 5c182458
      Herbert Xu 提交于
      As discovered by Timo Teräs, the currently xfrm_state_walk scheme
      is racy because if a second dump finishes before the first, we
      may free xfrm states that the first dump would walk over later.
      
      This patch fixes this by storing the dumps in a list in order
      to calculate the correct completion counter which cures this
      problem.
      
      I've expanded netlink_cb in order to accomodate the extra state
      related to this.  It shouldn't be a big deal since netlink_cb
      is kmalloced for each dump and we're just increasing it by 4 or
      8 bytes.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      5c182458
  8. 10 9月, 2008 2 次提交
  9. 09 9月, 2008 1 次提交
  10. 03 9月, 2008 1 次提交
    • D
      ipsec: Fix deadlock in xfrm_state management. · 37b08e34
      David S. Miller 提交于
      Ever since commit 4c563f76
      ("[XFRM]: Speed up xfrm_policy and xfrm_state walking") it is
      illegal to call __xfrm_state_destroy (and thus xfrm_state_put())
      with xfrm_state_lock held.  If we do, we'll deadlock since we
      have the lock already and __xfrm_state_destroy() tries to take
      it again.
      
      Fix this by pushing the xfrm_state_put() calls after the lock
      is dropped.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      37b08e34
  11. 26 7月, 2008 1 次提交
  12. 28 4月, 2008 2 次提交
  13. 25 3月, 2008 1 次提交
  14. 29 2月, 2008 1 次提交
    • T
      [XFRM]: Speed up xfrm_policy and xfrm_state walking · 4c563f76
      Timo Teras 提交于
      Change xfrm_policy and xfrm_state walking algorithm from O(n^2) to O(n).
      This is achieved adding the entries to one more list which is used
      solely for walking the entries.
      
      This also fixes some races where the dump can have duplicate or missing
      entries when the SPD/SADB is modified during an ongoing dump.
      
      Dumping SADB with 20000 entries using "time ip xfrm state" the sys
      time dropped from 1.012s to 0.080s.
      Signed-off-by: NTimo Teras <timo.teras@iki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4c563f76
  15. 02 2月, 2008 1 次提交
  16. 01 2月, 2008 2 次提交
  17. 29 1月, 2008 5 次提交
    • E
      [XFRM]: xfrm_state_clone() should be static, not exported · 6666351d
      Eric Dumazet 提交于
      xfrm_state_clone() is not used outside of net/xfrm/xfrm_state.c
      There is no need to export it.
      
      Spoted by sparse checker.
         CHECK   net/xfrm/xfrm_state.c
      net/xfrm/xfrm_state.c:1103:19: warning: symbol 'xfrm_state_clone' was not
      declared. Should it be static?
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6666351d
    • I
      [XFRM]: Kill some bloat · cf35f43e
      Ilpo Järvinen 提交于
      net/xfrm/xfrm_state.c:
        xfrm_audit_state_delete          | -589
        xfrm_replay_check                | -542
        xfrm_audit_state_icvfail         | -520
        xfrm_audit_state_add             | -589
        xfrm_audit_state_replay_overflow | -523
        xfrm_audit_state_notfound_simple | -509
        xfrm_audit_state_notfound        | -521
       7 functions changed, 3793 bytes removed, diff: -3793
      
      net/xfrm/xfrm_state.c:
        xfrm_audit_helper_pktinfo | +522
        xfrm_audit_helper_sainfo  | +598
       2 functions changed, 1120 bytes added, diff: +1120
      
      net/xfrm/xfrm_state.o:
       9 functions changed, 1120 bytes added, 3793 bytes removed, diff: -2673
      Signed-off-by: NIlpo Järvinen <ilpo.jarvinen@helsinki.fi>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      cf35f43e
    • E
      [NET]: Add some acquires/releases sparse annotations. · 9a429c49
      Eric Dumazet 提交于
      Add __acquires() and __releases() annotations to suppress some sparse
      warnings.
      
      example of warnings :
      
      net/ipv4/udp.c:1555:14: warning: context imbalance in 'udp_seq_start' - wrong
      count at exit
      net/ipv4/udp.c:1571:13: warning: context imbalance in 'udp_seq_stop' -
      unexpected unlock
      Signed-off-by: NEric Dumazet <dada1@cosmosbay.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      9a429c49
    • P
      [XFRM]: RFC4303 compliant auditing · afeb14b4
      Paul Moore 提交于
      This patch adds a number of new IPsec audit events to meet the auditing
      requirements of RFC4303.  This includes audit hooks for the following events:
      
       * Could not find a valid SA [sections 2.1, 3.4.2]
         . xfrm_audit_state_notfound()
         . xfrm_audit_state_notfound_simple()
      
       * Sequence number overflow [section 3.3.3]
         . xfrm_audit_state_replay_overflow()
      
       * Replayed packet [section 3.4.3]
         . xfrm_audit_state_replay()
      
       * Integrity check failure [sections 3.4.4.1, 3.4.4.2]
         . xfrm_audit_state_icvfail()
      
      While RFC4304 deals only with ESP most of the changes in this patch apply to
      IPsec in general, i.e. both AH and ESP.  The one case, integrity check
      failure, where ESP specific code had to be modified the same was done to the
      AH code for the sake of consistency.
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      afeb14b4
    • P
      [XFRM]: Assorted IPsec fixups · 68277acc
      Paul Moore 提交于
      This patch fixes a number of small but potentially troublesome things in the
      XFRM/IPsec code:
      
       * Use the 'audit_enabled' variable already in include/linux/audit.h
         Removed the need for extern declarations local to each XFRM audit fuction
      
       * Convert 'sid' to 'secid' everywhere we can
         The 'sid' name is specific to SELinux, 'secid' is the common naming
         convention used by the kernel when refering to tokenized LSM labels,
         unfortunately we have to leave 'ctx_sid' in 'struct xfrm_sec_ctx' otherwise
         we risk breaking userspace
      
       * Convert address display to use standard NIP* macros
         Similar to what was recently done with the SPD audit code, this also also
         includes the removal of some unnecessary memcpy() calls
      
       * Move common code to xfrm_audit_common_stateinfo()
         Code consolidation from the "less is more" book on software development
      
       * Proper spacing around commas in function arguments
         Minor style tweak since I was already touching the code
      Signed-off-by: NPaul Moore <paul.moore@hp.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      68277acc