diff options
-rw-r--r-- | net/core/sock_diag.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/core/sock_diag.c b/net/core/sock_diag.c index b9868e1fd62..aa74be442df 100644 --- a/net/core/sock_diag.c +++ b/net/core/sock_diag.c @@ -126,6 +126,9 @@ static int __sock_diag_rcv_msg(struct sk_buff *skb, struct nlmsghdr *nlh) if (nlmsg_len(nlh) < sizeof(*req)) return -EINVAL; + if (req->sdiag_family >= AF_MAX) + return -EINVAL; + hndl = sock_diag_lock_handler(req->sdiag_family); if (hndl == NULL) err = -ENOENT; |