xfrm: validate attributes
authorjamal <hadi@cyberus.ca>
Tue, 9 Feb 2010 03:59:38 +0000 (03:59 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 12 Feb 2010 21:27:47 +0000 (13:27 -0800)
Some XFRM attributes were not going through basic validation.

Signed-off-by: Jamal Hadi Salim <hadi@cyberus.ca>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/xfrm/xfrm_user.c

index d5a712976004cdc4c8fbdfcd53baa501abd59b39..943c8712bd971c6372d0326c3e428630c0981aa4 100644 (file)
@@ -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) },