aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet/ipsec/ipsec.h
diff options
context:
space:
mode:
authorMatthew Smith <mgsmith@netgate.com>2019-07-08 14:45:04 -0500
committerNeale Ranns <nranns@cisco.com>2019-07-12 14:23:28 +0000
commit401aedfb032d69daa876544e8e0a2973d69c50ac (patch)
tree4c4caf2f1a84bc0548b5973fc5794bab487e2649 /src/vnet/ipsec/ipsec.h
parent43ba29267b1f1db04cba0af1f994a5c8477ca870 (diff)
ipsec: drop outbound ESP when no crypto alg set
Type: fix If a tunnel interface has the crypto alg set on the outbound SA to IPSEC_CRYPTO_ALG_NONE and packets are sent out that interface, the attempt to write an ESP trailer on the packet occurs at the wrong offset and the vnet buffer opaque data is corrupted, which can result in a SEGV when a subsequent node attempts to use that data. When an outbound SA is set on a tunnel interface which has no crypto alg set, add a node to the ip{4,6}-output feature arcs which drops all packets leaving that interface instead of adding the node which would try to encrypt the packets. Change-Id: Ie0ac8d8fdc8a035ab8bb83b72b6a94161bebaa48 Signed-off-by: Matthew Smith <mgsmith@netgate.com>
Diffstat (limited to 'src/vnet/ipsec/ipsec.h')
-rw-r--r--src/vnet/ipsec/ipsec.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/vnet/ipsec/ipsec.h b/src/vnet/ipsec/ipsec.h
index c77d0fe7dd8..ccbe7d7aa5c 100644
--- a/src/vnet/ipsec/ipsec.h
+++ b/src/vnet/ipsec/ipsec.h
@@ -142,6 +142,10 @@ typedef struct
u32 esp4_encrypt_tun_feature_index;
u32 esp6_encrypt_tun_feature_index;
+ /* tun nodes to drop packets when no crypto alg set on outbound SA */
+ u32 esp4_no_crypto_tun_feature_index;
+ u32 esp6_no_crypto_tun_feature_index;
+
/* pool of ah backends */
ipsec_ah_backend_t *ah_backends;
/* pool of esp backends */
@@ -241,6 +245,9 @@ ipsec_sa_get (u32 sa_index)
return (pool_elt_at_index (ipsec_main.sad, sa_index));
}
+void ipsec_add_feature (const char *arc_name, const char *node_name,
+ u32 * out_feature_index);
+
#endif /* __IPSEC_H__ */
/*