Re: [ipsec] bug report: possible memory overwrite for IPv6 IPsec



On Tue, 8 Apr 2008, blue wrote:

Dear all:

struct secashead defined in keydb.h line 89:

/* Security Association Data Base */
struct secashead {
LIST_ENTRY(secashead) chain;

struct secasindex saidx;

struct secident *idents; /* source identity */
struct secident *identd; /* destination identity */
/* XXX I don't know how to use them. */

u_int8_t state; /* MATURE or DEAD. */
LIST_HEAD(_satree, secasvar) savtree[SADB_SASTATE_MAX+1];
/* SA chain */
/* The first of this list is newer SA */

struct route sa_route; /* route cache */
};

The last field "sa_route" is "struct route", whose space is not enough for IPv6 address. However, in ipsec6_output_tunnel() in ipsec_output.c, the field could possibly be assigned with an IPv6 address.

My suggestion is to enlarge the field as struct route_in6, which could accommodate both IPv4 and IPv6 address.


Can you please file a PR for this. Thanks.


--
Bjoern A. Zeeb bzeeb at Zabbadoz dot NeT
Software is harder than hardware so better get it right the first time.
_______________________________________________
freebsd-net@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-net
To unsubscribe, send any mail to "freebsd-net-unsubscribe@xxxxxxxxxxx"



Relevant Pages

  • [ipsec] bug report: possible memory overwrite for IPv6 IPsec
    ... struct secashead defined in keydb.h line 89: ... The last field "sa_route" is "struct route", whose space is not enough for IPv6 address. ... However, in ipsec6_output_tunnelin ipsec_output.c, the field could possibly be assigned with an IPv6 address. ...
    (freebsd-net)
  • Re: [PATCH] s390 - mark IPv6 support for QETH as broken
    ... defines that as opaque data. ... There is no other ipv6 specific field. ... A simple solution will be adding a pointer to a public struct with ipv6 ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • Re: Linux 2.6.19
    ... Reverting that patch fixes things up for me. ... I suspect that it might be because I removed the IPV6 ... needs to explicitly allocate space for the struct ipv6hdr in 'len'. ... if (err < 0) ...
    (Linux-Kernel)
  • constructing IPv6 in6_addr structure from ipv6
    ... Is there a recommended way to construct a struct sockaddr_in6 in kernel ... which is the format the connect function on a socket requires for ipv6 ... send the line "unsubscribe linux-kernel" in ...
    (Linux-Kernel)
  • raw IPv6 packets on Linux
    ... I am currently porting an application from IPv4 to IPv6. ... code uses some raw IPV4 packets with a structure defined as ... struct iphdr ip; ... one doesnt seem to be a complete fit as it doesnt seem to have all the ...
    (comp.os.linux.networking)