--- a/net/rds/bind.c +++ b/net/rds/bind.c @@ -168,6 +168,9 @@ int rds_bind(struct socket *sock, struct sockaddr *uaddr, int addr_len) int ret = 0; __be16 port; + if (addr_len == 0) + return -EINVAL; + /* We allow an RDS socket to be bound to either IPv4 or IPv6 * address. */