diff --git a/security/selinux/hooks.c b/security/selinux/hooks.c index b5017beb4ef7d65e446fd23db52d114995486bc2..d2488821cbd553efbd8cd74cf149e5154fd72fc3 100644 --- a/security/selinux/hooks.c +++ b/security/selinux/hooks.c @@ -5362,6 +5362,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 */