1. 23 9月, 2006 24 次提交
  2. 21 9月, 2006 5 次提交
  3. 14 8月, 2006 1 次提交
    • D
      [IPSEC]: Validate properly in xfrm_dst_check() · d49c73c7
      David S. Miller 提交于
      If dst->obsolete is -1, this is a signal from the
      bundle creator that we want the XFRM dst and the
      dsts that it references to be validated on every
      use.
      
      I misunderstood this intention when I changed
      xfrm_dst_check() to always return NULL.
      
      Now, when we purge a dst entry, by running dst_free()
      on it.  This will set the dst->obsolete to a positive
      integer, and we want to return NULL in that case so
      that the socket does a relookup for the route.
      
      Thus, if dst->obsolete<0, let stale_bundle() validate
      the state, else always return NULL.
      
      In general, we need to do things more intelligently
      here because we flush too much state during rule
      changes.  Herbert Xu has some ideas wherein the key
      manager gives us some help in this area.  We can also
      use smarter state management algorithms inside of
      the kernel as well.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      d49c73c7
  4. 22 7月, 2006 1 次提交
  5. 01 7月, 2006 1 次提交
  6. 30 6月, 2006 2 次提交
  7. 18 6月, 2006 4 次提交
    • D
      [NET]: Fix warnings after LSM-IPSEC changes. · 6f68dc37
      David S. Miller 提交于
      Assignment used as truth value in xfrm_del_sa()
      and xfrm_get_policy().
      
      Wrong argument type declared for security_xfrm_state_delete()
      when SELINUX is disabled.
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      6f68dc37
    • C
      [LSM-IPsec]: SELinux Authorize · c8c05a8e
      Catherine Zhang 提交于
      This patch contains a fix for the previous patch that adds security
      contexts to IPsec policies and security associations.  In the previous
      patch, no authorization (besides the check for write permissions to
      SAD and SPD) is required to delete IPsec policies and security
      assocations with security contexts.  Thus a user authorized to change
      SAD and SPD can bypass the IPsec policy authorization by simply
      deleteing policies with security contexts.  To fix this security hole,
      an additional authorization check is added for removing security
      policies and security associations with security contexts.
      
      Note that if no security context is supplied on add or present on
      policy to be deleted, the SELinux module allows the change
      unconditionally.  The hook is called on deletion when no context is
      present, which we may want to change.  At present, I left it up to the
      module.
      
      LSM changes:
      
      The patch adds two new LSM hooks: xfrm_policy_delete and
      xfrm_state_delete.  The new hooks are necessary to authorize deletion
      of IPsec policies that have security contexts.  The existing hooks
      xfrm_policy_free and xfrm_state_free lack the context to do the
      authorization, so I decided to split authorization of deletion and
      memory management of security data, as is typical in the LSM
      interface.
      
      Use:
      
      The new delete hooks are checked when xfrm_policy or xfrm_state are
      deleted by either the xfrm_user interface (xfrm_get_policy,
      xfrm_del_sa) or the pfkey interface (pfkey_spddelete, pfkey_delete).
      
      SELinux changes:
      
      The new policy_delete and state_delete functions are added.
      Signed-off-by: NCatherine Zhang <cxzhang@watson.ibm.com>
      Signed-off-by: NTrent Jaeger <tjaeger@cse.psu.edu>
      Acked-by: NJames Morris <jmorris@namei.org>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      c8c05a8e
    • H
      [IPSEC] xfrm: Abstract out encapsulation modes · b59f45d0
      Herbert Xu 提交于
      This patch adds the structure xfrm_mode.  It is meant to represent
      the operations carried out by transport/tunnel modes.
      
      By doing this we allow additional encapsulation modes to be added
      without clogging up the xfrm_input/xfrm_output paths.
      
      Candidate modes include 4-to-6 tunnel mode, 6-to-4 tunnel mode, and
      BEET modes.
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b59f45d0
    • H
      [IPSEC] xfrm: Undo afinfo lock proliferation · 546be240
      Herbert Xu 提交于
      The number of locks used to manage afinfo structures can easily be reduced
      down to one each for policy and state respectively.  This is based on the
      observation that the write locks are only held by module insertion/removal
      which are very rare events so there is no need to further differentiate
      between the insertion of modules like ipv6 versus esp6.
      
      The removal of the read locks in xfrm4_policy.c/xfrm6_policy.c might look
      suspicious at first.  However, after you realise that nobody ever takes
      the corresponding write lock you'll feel better :)
      
      As far as I can gather it's an attempt to guard against the removal of
      the corresponding modules.  Since neither module can be unloaded at all
      we can leave it to whoever fixes up IPv6 unloading :)
      Signed-off-by: NHerbert Xu <herbert@gondor.apana.org.au>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      546be240
  8. 23 5月, 2006 1 次提交
  9. 30 4月, 2006 1 次提交
    • I
      [XFRM]: fix incorrect xfrm_policy_afinfo_lock use · e959d812
      Ingo Molnar 提交于
      xfrm_policy_afinfo_lock can be taken in bh context, at:
      
       [<c013fe1a>] lockdep_acquire_read+0x54/0x6d
       [<c0f6e024>] _read_lock+0x15/0x22
       [<c0e8fcdb>] xfrm_policy_get_afinfo+0x1a/0x3d
       [<c0e8fd10>] xfrm_decode_session+0x12/0x32
       [<c0e66094>] ip_route_me_harder+0x1c9/0x25b
       [<c0e770d3>] ip_nat_local_fn+0x94/0xad
       [<c0e2bbc8>] nf_iterate+0x2e/0x7a
       [<c0e2bc50>] nf_hook_slow+0x3c/0x9e
       [<c0e3a342>] ip_push_pending_frames+0x2de/0x3a7
       [<c0e53e19>] icmp_push_reply+0x136/0x141
       [<c0e543fb>] icmp_reply+0x118/0x1a0
       [<c0e54581>] icmp_echo+0x44/0x46
       [<c0e53fad>] icmp_rcv+0x111/0x138
       [<c0e36764>] ip_local_deliver+0x150/0x1f9
       [<c0e36be2>] ip_rcv+0x3d5/0x413
       [<c0df760f>] netif_receive_skb+0x337/0x356
       [<c0df76c3>] process_backlog+0x95/0x110
       [<c0df5fe2>] net_rx_action+0xa5/0x16d
       [<c012d8a7>] __do_softirq+0x6f/0xe6
       [<c0105ec2>] do_softirq+0x52/0xb1
      
      this means that all write-locking of xfrm_policy_afinfo_lock must be
      bh-safe. This patch fixes xfrm_policy_register_afinfo() and
      xfrm_policy_unregister_afinfo().
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      e959d812