Skip to contentSkip to conversation

xfrm: validate attributes

PATCH Applied jamal 2 participants 2 messages Feb 9, 2010 – Feb 12, 2010

Subsystems (3)
lore
Share & tools
lore

jamal

author
#0 lore raw

PATCH 1/1 xfrm: validate attributes

make sure all XFRMAs go through validation in case wrong content is passed

cheers,
jamal

commit 979fef2abd38392e28c851215c59d1128fe0f776

Author: Jamal Hadi Salim <[email protected]>
Date:   Tue Feb 9 08:47:57 2010 -0500

xfrm: validate attributes

Some XFRM attributes were not going through basic validation.

net/xfrm/xfrm_user.c +4 -0
index d5a7129..943c871 100644
@@ -2054,6 +2054,10 @@ static const int xfrm_msg_min[XFRM_NR_MSGTYPES] = {
 #undef XMSGSIZE
 
 static const struct nla_policy xfrma_policy[XFRMA_MAX+1] = {
+	[XFRMA_SA]		= { .len = sizeof(struct xfrm_usersa_info)},
+	[XFRMA_POLICY]		= { .len = sizeof(struct xfrm_userpolicy_info)},
+	[XFRMA_LASTUSED]	= { .type = NLA_U64},
+	[XFRMA_ALG_AUTH_TRUNC]	= { .len = sizeof(struct xfrm_algo_auth)},
 	[XFRMA_ALG_AEAD]	= { .len = sizeof(struct xfrm_algo_aead) },
 	[XFRMA_ALG_AUTH]	= { .len = sizeof(struct xfrm_algo) },
 	[XFRMA_ALG_CRYPT]	= { .len = sizeof(struct xfrm_algo) },