Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9f138fa6 authored by Alexander Potapenko's avatar Alexander Potapenko Committed by David S. Miller
Browse files

net: initialize msg.msg_flags in recvfrom



KMSAN reports a use of uninitialized memory in put_cmsg() because
msg.msg_flags in recvfrom haven't been initialized properly.
The flag values don't affect the result on this path, but it's still a
good idea to initialize them explicitly.

Signed-off-by: default avatarAlexander Potapenko <glider@google.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8ddbb312
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1731,6 +1731,7 @@ SYSCALL_DEFINE6(recvfrom, int, fd, void __user *, ubuf, size_t, size,
	/* We assume all kernel code knows the size of sockaddr_storage */
	msg.msg_namelen = 0;
	msg.msg_iocb = NULL;
	msg.msg_flags = 0;
	if (sock->file->f_flags & O_NONBLOCK)
		flags |= MSG_DONTWAIT;
	err = sock_recvmsg(sock, &msg, flags);