summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_abr.h
diff options
context:
space:
mode:
authorDenis Ovsienko <infrastation@yandex.ru>2011-09-26 13:18:51 +0400
committerDenis Ovsienko <infrastation@yandex.ru>2011-09-26 18:47:16 +0400
commitabc7ef44ca05493500865ce81f7b84f5c4eb6594 (patch)
tree35504952c627e93203df81ebd5c96023879df00b /ospf6d/ospf6_abr.h
parent09395e2a0e93b2cf4258cb1de91887948796bb68 (diff)
ospf6d: CVE-2011-3323 (fortify packet reception)
This vulnerability (CERT-FI #514840) was reported by CROSS project. ospf6d processes IPv6 prefix structures in incoming packets without verifying that the declared prefix length is valid. This leads to a crash caused by out of bounds memory access. * ospf6_abr.h: new macros for size/alignment validation * ospf6_asbr.h: idem * ospf6_intra.h: idem * ospf6_lsa.h: idem * ospf6_message.h: idem * ospf6_proto.h: idem * ospf6_message.c * ospf6_packet_minlen: helper array for ospf6_packet_examin() * ospf6_lsa_minlen: helper array for ospf6_lsa_examin() * ospf6_hello_recv(): do not call ospf6_header_examin(), let upper layer verify the input data * ospf6_dbdesc_recv(): idem * ospf6_lsreq_recv(): idem * ospf6_lsupdate_recv(): idem * ospf6_lsack_recv(): idem * ospf6_prefixes_examin(): new function, implements A.4.1 * ospf6_lsa_examin(): new function, implements A.4 * ospf6_lsaseq_examin(): new function, an interface to above * ospf6_packet_examin(): new function, implements A.3 * ospf6_rxpacket_examin(): new function, replaces ospf6_header_examin() * ospf6_header_examin(): sayonara * ospf6_receive(): perform passive interface check earliest possible, employ ospf6_rxpacket_examin()
Diffstat (limited to 'ospf6d/ospf6_abr.h')
-rw-r--r--ospf6d/ospf6_abr.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/ospf6d/ospf6_abr.h b/ospf6d/ospf6_abr.h
index 86d00280..816f5964 100644
--- a/ospf6d/ospf6_abr.h
+++ b/ospf6d/ospf6_abr.h
@@ -35,6 +35,7 @@ extern unsigned char conf_debug_ospf6_abr;
(conf_debug_ospf6_abr)
/* Inter-Area-Prefix-LSA */
+#define OSPF6_INTER_PREFIX_LSA_MIN_SIZE 4U /* w/o IPv6 prefix */
struct ospf6_inter_prefix_lsa
{
u_int32_t metric;
@@ -42,6 +43,7 @@ struct ospf6_inter_prefix_lsa
};
/* Inter-Area-Router-LSA */
+#define OSPF6_INTER_ROUTER_LSA_FIX_SIZE 12U
struct ospf6_inter_router_lsa
{
u_char mbz;