13 Feb, 2008

1 commit


01 Feb, 2008

1 commit


29 Jan, 2008

4 commits

  • Let's nip the code duplication in the bud :)

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • 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: Paul Moore
    Acked-by: James Morris
    Signed-off-by: David S. Miller

    Paul Moore
     
  • This patch releases the lock on the state before calling
    x->type->input. It also adds the lock to the spots where they're
    currently needed.

    Most of those places (all except mip6) are expected to disappear with
    async crypto.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Similar to the moving out of the replay processing on the output, this
    patch moves the integrity stat collectin from x->type->input into
    xfrm_input.

    This would eventually allow transforms such as AH/ESP to be lockless.

    The error value EBADMSG (currently unused in the crypto layer) is used
    to indicate a failed integrity check. In future this error can be
    directly returned by the crypto layer once we switch to aead
    algorithms.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

02 Nov, 2007

1 commit


22 Oct, 2007

1 commit


18 Oct, 2007

2 commits

  • Combining RO and AH/ESP/IPCOMP does not make sense. So this patch adds a
    check in the state initialisation function to prevent this.

    This allows us to safely remove the mode input function of RO since it
    can never be called anymore. Indeed, if somehow it does get called we'll
    know about it through an OOPS instead of it slipping past silently.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Not every transform needs to zap ip_summed. For example, a pure tunnel
    mode encapsulation does not affect the hardware checksum at all. In fact,
    every algorithm (that needs this) other than AH6 already does its own
    ip_summed zapping.

    This patch moves the zapping into AH6 which is in line with what IPv4 does.

    Possible future optimisation: Checksum the data as we copy them in IPComp.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

11 Oct, 2007

6 commits

  • This patch removes the duplicate ipv6_{auth,esp,comp}_hdr structures since
    they're identical to the IPv4 versions. Duplicating them would only create
    problems for ourselves later when we need to add things like extended
    sequence numbers.

    I've also added transport header type conversion headers for these types
    which are now used by the transforms.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch changes the calling convention so that on entry from
    x->mode->output and before entry into x->type->output skb->data
    will point to the payload instead of the IP header.

    This is essentially a redistribution of skb_push/skb_pull calls
    with the aim of minimising them on the common path of tunnel +
    ESP.

    It'll also let us use the same calling convention between IPv4
    and IPv6 with the next patch.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • This patch releases the lock on the state before calling x->type->output.
    It also adds the lock to the spots where they're currently needed.

    Most of those places (all except mip6) are expected to disappear with
    async crypto.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • Current the x->mode->output functions store the IPv6 nh pointer in the
    skb network header. This is inconvenient because the network header then
    has to be fixed up before the packet can leave the IPsec stack. The mac
    header field is unused on output so we can use that to store this instead.

    This patch does that and removes the network header fix-up in xfrm_output.

    It also uses ipv6_hdr where appropriate in the x->type->output functions.

    There is also a minor clean-up in esp4 to make it use the same code as
    esp6 to help any subsequent effort to merge the two.

    Lastly it kills two redundant skb_set_* statements in BEET that were
    simply copied over from transport mode.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The replay counter is one of only two remaining things in the output code
    that requires a lock on the xfrm state (the other being the crypto). This
    patch moves it into the generic xfrm_output so we can remove the lock from
    the transforms themselves.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     
  • The keys are only used during initialisation so we don't need to carry them
    in esp_data. Since we don't have to allocate them again, there is no need
    to place a limit on the authentication key length anymore.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

11 Jul, 2007

3 commits

  • It is clean-up for XFRM type modules and adds aliases with its
    protocol:
    ESP, AH, IPCOMP, IPIP and IPv6 for IPsec
    ROUTING and DSTOPTS for MIPv6

    It is almost the same thing as XFRM mode alias, but it is added
    new defines XFRM_PROTO_XXX for preprocessing since some protocols
    are defined as enum.

    Signed-off-by: Masahide NAKAMURA
    Acked-by: Ingo Oeser
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • This patch makes MIPv6 loadable module named "mip6".

    Here is a modprobe.conf(5) example to load it automatically
    when user application uses XFRM state for MIPv6:

    alias xfrm-type-10-43 mip6
    alias xfrm-type-10-60 mip6

    Some MIPv6 feature is not included by this modular, however,
    it should not be affected to other features like either IPsec
    or IPv6 with and without the patch.
    We may discuss XFRM, MH (RAW socket) and ancillary data/sockopt
    separately for future work.

    Loadable features:
    * MH receiving check (to send ICMP error back)
    * RO header parsing and building (i.e. RH2 and HAO in DSTOPTS)
    * XFRM policy/state database handling for RO

    These are NOT covered as loadable:
    * Home Address flags and its rule on source address selection
    * XFRM sub policy (depends on its own kernel option)
    * XFRM functions to receive RO as IPv6 extension header
    * MH sending/receiving through raw socket if user application
    opens it (since raw socket allows to do so)
    * RH2 sending as ancillary data
    * RH2 operation with setsockopt(2)

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • Kill unnecessary CONFIG_IPV6_MIP6.

    o It is redundant for RAW socket to keep MH out with the config then
    it can handle any protocol.
    o Clean-up at AH.

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     

31 May, 2007

1 commit


26 Apr, 2007

5 commits


11 Feb, 2007

1 commit


03 Dec, 2006

2 commits

  • Code diff stats:

    [acme@newtoy net-2.6.20]$ codiff /tmp/ipv6.ko.before /tmp/ipv6.ko.after
    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv6/ip6_output.c:
    ip6_output | -52
    ip6_append_data | +2
    2 functions changed, 2 bytes added, 52 bytes removed

    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv6/addrconf.c:
    addrconf_sysctl_register | -27
    1 function changed, 27 bytes removed

    /pub/scm/linux/kernel/git/acme/net-2.6.20/net/ipv6/tcp_ipv6.c:
    tcp_v6_syn_recv_sock | -32
    tcp_v6_parse_md5_keys | -24
    2 functions changed, 56 bytes removed

    /tmp/ipv6.ko.after:
    5 functions changed, 2 bytes added, 135 bytes removed
    [acme@newtoy net-2.6.20]$

    Signed-off-by: Arnaldo Carvalho de Melo

    Arnaldo Carvalho de Melo
     
  • Signed-off-by: Al Viro
    Signed-off-by: David S. Miller

    Al Viro
     

23 Sep, 2006

4 commits

  • - Remove redundant code. Pointed out by Brian Haley .
    - Unify code paths with/without CONFIG_IPV6_MIP.
    - Use NIP6_FMT for IPv6 address textual presentation.
    - Fold long line. Pointed out by David Miller .

    Signed-off-by: YOSHIFUJI Hideaki

    YOSHIFUJI Hideaki
     
  • Mobile IPv6 defines home address option as an option of destination
    options header. It is placed before fragment header then
    ip6_find_1stfragopt() is fixed to know about it.

    Home address option also carries final source address of the flow,
    then outbound AH calculation should take care of it like routing
    header case. Based on MIPL2 kernel patch.

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • On current kernel, ip6_find_1stfragopt() is used by IPv6 IPsec to find
    offset to be inserted header in outbound for transport mode. (BTW, no
    usage may be needed for IPv4 case.) Mobile IPv6 requires another
    logic for routing header and destination options header
    respectively. This patch is common platform for the offset and adopts
    it to IPsec.

    Based on MIPL2 kernel patch.

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     
  • Transformation mode is used as either IPsec transport or tunnel.
    It is required to add two more items, route optimization and inbound trigger
    for Mobile IPv6.
    Based on MIPL2 kernel patch.

    This patch was also written by: Ville Nuorvala

    Signed-off-by: Masahide NAKAMURA
    Signed-off-by: YOSHIFUJI Hideaki
    Signed-off-by: David S. Miller

    Masahide NAKAMURA
     

21 Sep, 2006

1 commit

  • This patch converts IPsec to use the new HMAC template. The names of
    existing simple digest algorithms may still be used to refer to their
    HMAC composites.

    The same structure can be used by other MACs such as AES-XCBC-MAC.

    This patch also switches from the digest interface to hash.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Jul, 2006

1 commit


18 Jun, 2006

1 commit

  • Now that we have xfrm_mode objects we can move the transport mode specific
    input decapsulation code into xfrm_mode_transport. This removes duplicate
    code as well as unnecessary header movement in case of tunnel mode SAs
    since we will discard the original IP header immediately.

    This also fixes a minor bug for transport-mode ESP where the IP payload
    length is set to the correct value minus the header length (with extension
    headers for IPv6).

    Of course the other neat thing is that we no longer have to allocate
    temporary buffers to hold the IP headers for ESP and IPComp.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

01 Apr, 2006

1 commit

  • This patch removes the decap_state argument from the xfrm input hook.
    Previously this function allowed the input hook to share state with
    the post_input hook. The latter has since been removed.

    The only purpose for it now is to check the encap type. However, it
    is easier and better to move the encap type check to the generic
    xfrm_rcv function. This allows us to get rid of the decap state
    argument altogether.

    Signed-off-by: Herbert Xu
    Signed-off-by: David S. Miller

    Herbert Xu
     

21 Mar, 2006

2 commits


13 Mar, 2006

1 commit


14 Jan, 2006

1 commit

  • There are errors and inconsistency in the display of NIP6 strings.
    ie: net/ipv6/ip6_flowlabel.c

    There are errors and inconsistency in the display of NIPQUAD strings too.
    ie: net/netfilter/nf_conntrack_ftp.c

    This patch:
    adds NIP6_FMT to kernel.h
    changes all code to use NIP6_FMT
    fixes net/ipv6/ip6_flowlabel.c
    adds NIPQUAD_FMT to kernel.h
    fixes net/netfilter/nf_conntrack_ftp.c
    changes a few uses of "%u.%u.%u.%u" to NIPQUAD_FMT for symmetry to NIP6_FMT

    Signed-off-by: Joe Perches
    Signed-off-by: David S. Miller

    Joe Perches