mirror of
https://github.com/raspberrypi/linux.git
synced 2025-12-06 10:00:17 +00:00
netlink: fix uninit-value in netlink_sendmsg
commit6091f09c2fupstream. 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:1da177e4c3("Linux-2.6.12-rc2") 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
d7309c4e42
commit
4b016f0e74
@@ -1845,6 +1845,8 @@ static int netlink_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
|
|||||||
|
|
||||||
if (msg->msg_namelen) {
|
if (msg->msg_namelen) {
|
||||||
err = -EINVAL;
|
err = -EINVAL;
|
||||||
|
if (msg->msg_namelen < sizeof(struct sockaddr_nl))
|
||||||
|
goto out;
|
||||||
if (addr->nl_family != AF_NETLINK)
|
if (addr->nl_family != AF_NETLINK)
|
||||||
goto out;
|
goto out;
|
||||||
dst_portid = addr->nl_pid;
|
dst_portid = addr->nl_pid;
|
||||||
|
|||||||
Reference in New Issue
Block a user