1. 29 1月, 2008 6 次提交
    • H
      [IPSEC]: Merge most of the output path · 862b82c6
      Herbert Xu 提交于
      As part of the work on asynchrnous cryptographic operations, we need
      to be able to resume from the spot where they occur.  As such, it
      helps if we isolate them to one spot.
      
      This patch moves most of the remaining family-specific processing into
      the common output code.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      862b82c6
    • H
      [IPSEC]: Separate inner/outer mode processing on input · 227620e2
      Herbert Xu 提交于
      With inter-family transforms the inner mode differs from the outer
      mode.  Attempting to handle both sides from the same function means
      that it needs to handle both IPv4 and IPv6 which creates duplication
      and confusion.
      
      This patch separates the two parts on the input path so that each
      function deals with one family only.
      
      In particular, the functions xfrm4_extract_inut/xfrm6_extract_inut
      moves the pertinent fields from the IPv4/IPv6 IP headers into a
      neutral format stored in skb->cb.  This is then used by the inner mode
      input functions to modify the inner IP header.  In this way the input
      function no longer has to know about the outer address family.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      227620e2
    • H
      [IPSEC]: Separate inner/outer mode processing on output · 36cf9acf
      Herbert Xu 提交于
      With inter-family transforms the inner mode differs from the outer
      mode.  Attempting to handle both sides from the same function means
      that it needs to handle both IPv4 and IPv6 which creates duplication
      and confusion.
      
      This patch separates the two parts on the output path so that each
      function deals with one family only.
      
      In particular, the functions xfrm4_extract_output/xfrm6_extract_output
      moves the pertinent fields from the IPv4/IPv6 IP headers into a
      neutral format stored in skb->cb.  This is then used by the outer mode
      output functions to write the outer IP header.  In this way the output
      function no longer has to know about the inner address family.
      
      Since the extract functions are only called by tunnel modes (the only
      modes that can support inter-family transforms), I've also moved the
      xfrm*_tunnel_check_size calls into them.  This allows the correct ICMP
      message to be sent as opposed to now where you might call icmp_send
      with an IPv6 packet and vice versa.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      36cf9acf
    • H
      [IPSEC]: Merge common code into xfrm_bundle_create · 25ee3286
      Herbert Xu 提交于
      Half of the code in xfrm4_bundle_create and xfrm6_bundle_create are
      common.  This patch extracts that logic and puts it into
      xfrm_bundle_create.  The rest of it are then accessed through afinfo.
      
      As a result this fixes the problem with inter-family transforms where
      we treat every xfrm dst in the bundle as if it belongs to the top
      family.
      
      This patch also fixes a long-standing error-path bug where we may free
      the xfrm states twice.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      25ee3286
    • H
      [IPSEC]: Move flow construction into xfrm_dst_lookup · 66cdb3ca
      Herbert Xu 提交于
      This patch moves the flow construction from the callers of
      xfrm_dst_lookup into that function.  It also changes xfrm_dst_lookup
      so that it takes an xfrm state as its argument instead of explicit
      addresses.
      
      This removes any address-specific logic from the callers of
      xfrm_dst_lookup which is needed to correctly support inter-family
      transforms.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      66cdb3ca
    • H
      [IPSEC]: Replace x->type->{local,remote}_addr with flags · f04e7e8d
      Herbert Xu 提交于
      The functions local_addr and remote_addr are more than what they're
      needed for.  The same thing can be done easily with flags on the type
      object.  This patch does that and simplifies the wrapper functions in
      xfrm6_policy accordingly.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      f04e7e8d
  2. 09 1月, 2008 1 次提交
  3. 24 10月, 2007 1 次提交
  4. 18 10月, 2007 6 次提交
  5. 16 10月, 2007 1 次提交
  6. 11 10月, 2007 7 次提交
  7. 18 7月, 2007 1 次提交
  8. 11 7月, 2007 4 次提交
  9. 08 6月, 2007 1 次提交
    • J
      xfrm: Add security check before flushing SAD/SPD · 4aa2e62c
      Joy Latten 提交于
      Currently we check for permission before deleting entries from SAD and
      SPD, (see security_xfrm_policy_delete() security_xfrm_state_delete())
      However we are not checking for authorization when flushing the SPD and
      the SAD completely. It was perhaps missed in the original security hooks
      patch.
      
      This patch adds a security check when flushing entries from the SAD and
      SPD.  It runs the entire database and checks each entry for a denial.
      If the process attempting the flush is unable to remove all of the
      entries a denial is logged the the flush function returns an error
      without removing anything.
      
      This is particularly useful when a process may need to create or delete
      its own xfrm entries used for things like labeled networking but that
      same process should not be able to delete other entries or flush the
      entire database.
      
      Signed-off-by: Joy Latten<latten@austin.ibm.com>
      Signed-off-by: NEric Paris <eparis@parisplace.org>
      Signed-off-by: NJames Morris <jmorris@namei.org>
      4aa2e62c
  10. 31 5月, 2007 1 次提交
  11. 05 5月, 2007 2 次提交
  12. 30 4月, 2007 1 次提交
    • M
      [XFRM]: Restrict upper layer information by bundle. · 157bfc25
      Masahide NAKAMURA 提交于
      On MIPv6 usage, XFRM sub policy is enabled.
      When main (IPsec) and sub (MIPv6) policy selectors have the same
      address set but different upper layer information (i.e. protocol
      number and its ports or type/code), multiple bundle should be created.
      However, currently we have issue to use the same bundle created for
      the first time with all flows covered by the case.
      
      It is useful for the bundle to have the upper layer information
      to be restructured correctly if it does not match with the flow.
      
      1. Bundle was created by two policies
      Selector from another policy is added to xfrm_dst.
      If the flow does not match the selector, it goes to slow path to
      restructure new bundle by single policy.
      
      2. Bundle was created by one policy
      Flow cache is added to xfrm_dst as originated one. If the flow does
      not match the cache, it goes to slow path to try searching another
      policy.
      Signed-off-by: NMasahide NAKAMURA <nakam@linux-ipv6.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      157bfc25
  13. 29 4月, 2007 1 次提交
  14. 26 4月, 2007 2 次提交
    • J
      [XFRM]: Export SAD info. · 28d8909b
      Jamal Hadi Salim 提交于
      On a system with a lot of SAs, counting SAD entries chews useful
      CPU time since you need to dump the whole SAD to user space;
      i.e something like ip xfrm state ls | grep -i src | wc -l
      I have seen taking literally minutes on a 40K SAs when the system
      is swapping.
      With this patch, some of the SAD info (that was already being tracked)
      is exposed to user space. i.e you do:
      ip xfrm state count
      And you get the count; you can also pass -s to the command line and
      get the hash info.
      Signed-off-by: NJamal Hadi Salim <hadi@cyberus.ca>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      28d8909b
    • P
      [XFRM]: Optimize MTU calculation · c5c25238
      Patrick McHardy 提交于
      Replace the probing based MTU estimation, which usually takes 2-3 iterations
      to find a fitting value and may underestimate the MTU, by an exact calculation.
      
      Also fix underestimation of the XFRM trailer_len, which causes unnecessary
      reallocations.
      Signed-off-by: NPatrick McHardy <kaber@trash.net>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c5c25238
  15. 08 3月, 2007 1 次提交
    • E
      [IPSEC]: xfrm_policy delete security check misplaced · ef41aaa0
      Eric Paris 提交于
      The security hooks to check permissions to remove an xfrm_policy were
      actually done after the policy was removed.  Since the unlinking and
      deletion are done in xfrm_policy_by* functions this moves the hooks
      inside those 2 functions.  There we have all the information needed to
      do the security check and it can be done before the deletion.  Since
      auditing requires the result of that security check err has to be passed
      back and forth from the xfrm_policy_by* functions.
      
      This patch also fixes a bug where a deletion that failed the security
      check could cause improper accounting on the xfrm_policy
      (xfrm_get_policy didn't have a put on the exit path for the hold taken
      by xfrm_policy_by*)
      
      It also fixes the return code when no policy is found in
      xfrm_add_pol_expire.  In old code (at least back in the 2.6.18 days) err
      wasn't used before the return when no policy is found and so the
      initialization would cause err to be ENOENT.  But since err has since
      been used above when we don't get a policy back from the xfrm_policy_by*
      function we would always return 0 instead of the intended ENOENT.  Also
      fixed some white space damage in the same area.
      Signed-off-by: NEric Paris <eparis@redhat.com>
      Acked-by: NVenkat Yekkirala <vyekkirala@trustedcs.com>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      ef41aaa0
  16. 14 2月, 2007 2 次提交
  17. 09 2月, 2007 2 次提交