From: Eric Dumazet <edumazet@google.com>
To: "David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
Eric Dumazet <edumazet@google.com>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: [PATCH net 2/8] netlink: fix uninit-value in netlink_sendmsg
Date: Sat, 7 Apr 2018 13:42:37 -0700 [thread overview]
Message-ID: <20180407204243.176626-3-edumazet@google.com> (raw)
In-Reply-To: <20180407204243.176626-1-edumazet@google.com>
syzbot reported :
BUG: KMSAN: uninit-value in ffs arch/x86/include/asm/bitops.h:432 [inline]
BUG: KMSAN: uninit-value in netlink_sendmsg+0xb26/0x1310 net/netlink/af_netlink.c:1851
Fixes: 1da177e4c3f4 ("Linux-2.6.12-rc2")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
---
net/netlink/af_netlink.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c
index fa556fdef57d8a684bd73de05821514482db2eea..55342c4d5cec6a999065aa1c9607bdf476c59d36 100644
--- a/net/netlink/af_netlink.c
+++ b/net/netlink/af_netlink.c
@@ -1844,6 +1844,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
if (msg->msg_namelen) {
err = -EINVAL;
+ if (msg->msg_namelen < sizeof(struct sockaddr_nl))
+ goto out;
if (addr->nl_family != AF_NETLINK)
goto out;
dst_portid = addr->nl_pid;
--
2.17.0.484.g0c8726318c-goog
next prev parent reply other threads:[~2018-04-07 20:43 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-04-07 20:42 [PATCH net 0/8] net: fix uninit-values in networking stack Eric Dumazet
2018-04-07 20:42 ` [PATCH net 1/8] crypto: af_alg - fix possible uninit-value in alg_bind() Eric Dumazet
2018-04-07 20:42 ` Eric Dumazet [this message]
2018-04-07 20:42 ` [PATCH net 3/8] net: fix rtnh_ok() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 4/8] net: initialize skb->peeked when cloning Eric Dumazet
2018-04-07 20:42 ` [PATCH net 5/8] net: fix uninit-value in __hw_addr_add_ex() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 6/8] dccp: initialize ireq->ir_mark Eric Dumazet
2018-04-07 20:42 ` [PATCH net 7/8] ipv4: fix uninit-value in ip_route_output_key_hash_rcu() Eric Dumazet
2018-04-07 20:42 ` [PATCH net 8/8] soreuseport: initialise timewait reuseport field Eric Dumazet
2018-04-08 2:40 ` [PATCH net 0/8] net: fix uninit-values in networking stack David Miller
2018-04-08 16:38 ` Eric Dumazet
2018-04-08 16:49 ` David Miller
2018-04-08 16:55 ` Eric Dumazet
2018-04-08 21:18 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180407204243.176626-3-edumazet@google.com \
--to=edumazet@google.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).