diff options
| author | Eric Dumazet <edumazet@google.com> | 2018-04-07 13:42:37 -0700 |
|---|---|---|
| committer | Moyster <oysterized@gmail.com> | 2019-05-03 18:56:20 +0200 |
| commit | 1df1f4c9f020c5fd2e71af6880fefe70645f7e8c (patch) | |
| tree | 3e8f68a63886750bc58229db58e2209365a88cf4 /net | |
| parent | db43a7f452ff14bb4371717dc24947692094d2a7 (diff) | |
netlink: fix uninit-value in netlink_sendmsg
commit 6091f09c2f79730d895149bcfe3d66140288cd0e upstream.
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")
Change-Id: I65447ae00ea872c090e506fee72b9e5f2171748b
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reported-by: syzbot <syzkaller@googlegroups.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net')
| -rw-r--r-- | net/netlink/af_netlink.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/netlink/af_netlink.c b/net/netlink/af_netlink.c index 82f9a03ef..998824e4e 100644 --- a/net/netlink/af_netlink.c +++ b/net/netlink/af_netlink.c @@ -2120,6 +2120,8 @@ static int netlink_sendmsg(struct kiocb *kiocb, struct socket *sock, 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; |
