diff --git a/net/sctp/socket.c b/net/sctp/socket.c index d2665bbd41a2..f52fe90d3e00 100644 --- a/net/sctp/socket.c +++ b/net/sctp/socket.c @@ -7033,7 +7033,7 @@ static int sctp_getsockopt_peer_auth_chunks(struct sock *sk, int len, /* See if the user provided enough room for all the data */ num_chunks = ntohs(ch->param_hdr.length) - sizeof(struct sctp_paramhdr); - if (len < num_chunks) + if (len < sizeof(struct sctp_authchunks) + num_chunks) return -EINVAL; if (copy_to_user(to, ch->chunks, num_chunks))