In the Linux kernel, the following vulnerability has been resolved:
net: fix uninit-value in caif_seqpkt_sendmsg
When nr_segs equal to zero in iovec_from_user, the object
msg->msg_iter.iov is uninit stack memory in caif_seqpkt_sendmsg
which is defined in ___sys_sendmsg. So we cann't just judge
msg->msg_iter.iov->base directlly. We can use nr_segs to judge
msg in caif_seqpkt_sendmsg whether has data buffers.
=====================================================BUG: KMSAN: uninit-value in caif_seqpkt_sendmsg+0x693/0xf60net/caif/caif_socket.c:542Call Trace:__dump_stacklib/dump_stack.c:77[inline]dump_stack+0x1c9/0x220lib/dump_stack.c:118kmsan_report+0xf7/0x1e0mm/kmsan/kmsan_report.c:118__msan_warning+0x58/0xa0mm/kmsan/kmsan_instr.c:215caif_seqpkt_sendmsg+0x693/0xf60net/caif/caif_socket.c:542sock_sendmsg_nosecnet/socket.c:652[inline]sock_sendmsgnet/socket.c:672[inline]____sys_sendmsg+0x12b6/0x1350net/socket.c:2343___sys_sendmsgnet/socket.c:2397[inline]__sys_sendmmsg+0x808/0xc90net/socket.c:2480__compat_sys_sendmmsgnet/compat.c:656[inline]