sctp: check len in sctp_getsockopt_assoc_stats()
Subsystems (4)
PATCH 1/1 sctp: check len in sctp_getsockopt_assoc_stats()
This check is missing an upper bound.
Signed-off-by Dan Carpenter <[email protected]>
---
This should go in 3.8 -stable as well.
net/sctp/socket.c +2 -0
@@ -5652,6 +5652,8 @@ static int sctp_getsockopt_assoc_stats(struct sock *sk, int len,/* User must provide at least the assoc id */ if (len <sizeof (sctp_assoc_t))return -EINVAL ; +if (len >sizeof (struct sctp_assoc_stats )) + len =sizeof (struct sctp_assoc_stats );if (copy_from_user (&sas, optval, len))return -EFAULT ;
David Miller
maintainerFrom: Dan Carpenter <[email protected]>
Date: Wed, 27 Feb 2013 23:41:44 +0300
Quoted 5 lines
This check is missing an upper bound.
Signed-off-by Dan Carpenter <[email protected]>---
This should go in 3.8 -stable as well.
There is a discussion and patch on netdev already.