mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
xfrm: Reject excessive values for XFRMA_TFCPAD
tfcpad is a u32, but that full range is excessive for padding. Limit it to max IP length (64k). Signed-off-by: David Ahern <dahern@nvidia.com> Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
This commit is contained in:
parent
a77d172177
commit
41c4d3b26f
|
|
@ -937,8 +937,14 @@ static struct xfrm_state *xfrm_state_construct(struct net *net,
|
|||
attrs[XFRMA_ALG_COMP], extack)))
|
||||
goto error;
|
||||
|
||||
if (attrs[XFRMA_TFCPAD])
|
||||
if (attrs[XFRMA_TFCPAD]) {
|
||||
x->tfcpad = nla_get_u32(attrs[XFRMA_TFCPAD]);
|
||||
if (x->tfcpad > IP_MAX_MTU) {
|
||||
NL_SET_ERR_MSG(extack, "Excessive TFC padding");
|
||||
err = -EINVAL;
|
||||
goto error;
|
||||
}
|
||||
}
|
||||
|
||||
xfrm_mark_get(attrs, &x->mark);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user