xfrm: Reject excessive values for XFRMA_TFCPAD
Subsystems (3)
PATCH 1/1 xfrm: Reject excessive values for XFRMA_TFCPAD
From: David Ahern <[email protected]>
tfcpad is a u32, but that full range is excessive for padding. Limit it to max IP length (64k).
Signed-off-by David Ahern <[email protected]>
--- net/xfrm/xfrm_user.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
net/xfrm/xfrm_user.c +7 -1
@@ -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);
Signature · 1 line
2.43.0
Steffen Klassert
maintainerQuoted 6 lines · David Ahern
From: David Ahern <[email protected]>
tfcpad is a u32, but that full range is excessive for padding. Limit it to max IP length (64k).
Signed-off-by David Ahern <[email protected]>
Also applied, thanks a lot!