Message ID | 20240306100438.3953516-4-steffen.klassert@secunet.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 1a807e46aa93ebad1dfbed4f82dc3bf779423a6e |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | [1/5] xfrm: Clear low order bits of ->flowi4_tos in decode_session4(). | expand |
diff --git a/net/xfrm/xfrm_user.c b/net/xfrm/xfrm_user.c index ad01997c3aa9..444e58bc3f44 100644 --- a/net/xfrm/xfrm_user.c +++ b/net/xfrm/xfrm_user.c @@ -2017,6 +2017,9 @@ static int copy_to_user_tmpl(struct xfrm_policy *xp, struct sk_buff *skb) if (xp->xfrm_nr == 0) return 0; + if (xp->xfrm_nr > XFRM_MAX_DEPTH) + return -ENOBUFS; + for (i = 0; i < xp->xfrm_nr; i++) { struct xfrm_user_tmpl *up = &vec[i]; struct xfrm_tmpl *kp = &xp->xfrm_vec[i];