mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 09:36:22 +02:00
xfrm: restrict netlink attributes for XFRM_MSG_MIGRATE_STATE
Only accept XFRMA used in this method, reject the rest. Signed-off-by: Antony Antony <antony.antony@secunet.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
a9d155ea9b
commit
c4460171d7
|
|
@ -3788,6 +3788,30 @@ static int xfrm_reject_unused_attr(int type, struct nlattr **attrs,
|
|||
}
|
||||
}
|
||||
|
||||
if (type == XFRM_MSG_MIGRATE_STATE) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i <= XFRMA_MAX; i++) {
|
||||
if (!attrs[i])
|
||||
continue;
|
||||
|
||||
switch (i) {
|
||||
case XFRMA_MARK:
|
||||
case XFRMA_ENCAP:
|
||||
case XFRMA_OFFLOAD_DEV:
|
||||
case XFRMA_SET_MARK:
|
||||
case XFRMA_SET_MARK_MASK:
|
||||
case XFRMA_MTIMER_THRESH:
|
||||
case XFRMA_NAT_KEEPALIVE_INTERVAL:
|
||||
break;
|
||||
default:
|
||||
NL_SET_ERR_MSG_ATTR(extack, attrs[i],
|
||||
"Unsupported attribute in XFRM_MSG_MIGRATE_STATE");
|
||||
return -EINVAL;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user