Message ID | 20211220143017.987852710@linuxfoundation.org |
---|---|
State | New |
Headers | show |
Series | None | expand |
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 65cf129eaad33..2f23b7fef8ef7 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -1804,6 +1804,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;