diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 0886267ea81ef5c1ff0691b4b63fee38273add89..e55af5c078ac096985c842484a8a81e42bffadda 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1863,6 +1863,11 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len) if (msg->msg_flags & MSG_OOB) return -EOPNOTSUPP; + if (len == 0) { + pr_warn_once("Zero length message leads to an empty skb\n"); + return -ENODATA; + } + err = scm_send(sock, msg, &scm, true); if (err < 0) return err;