diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index 81e012c66d95..3745922c7132 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -5147,6 +5147,9 @@ static int selinux_sctp_bind_connect(struct sock *sk, int optname, return -EINVAL; } + if (walk_size + len > addrlen) + return -EINVAL; + err = -EINVAL; switch (optname) { /* Bind checks */