In the Linux kernel, the following vulnerability has been resolved: kcm: Fix error handling for SOCKDGRAM in kcmsendmsg(). syzkaller found a memory leak in kcmsendmsg(), and commit c821a88bd720 ("kcm: Fix memory leak in error path of kcmsendmsg()") suppressed it by updating kcmtxmsg(head)->lastskb if partial data is copied so that the following sendmsg() will resume from the skb. However, we cannot know how many bytes were copied when we get the error. Thus, we could mess up the MSGMORE queue. When kcmsendmsg() fails for SOCKDGRAM, we should purge the queue as we do so for UDP by udpflushpendingframes(). Even without this change, when the error occurred, the following sendmsg() resumed from a wrong skb and the queue was messed up. However, we have yet to get such a report, and only syzkaller stumbled on it. So, this can be changed safely. Note this does not change SOCKSEQPACKET behaviour.