From: Paolo Abeni <pab...@redhat.com> Date: Wed, 6 Jun 2018 15:16:29 +0200
> @@ -1126,7 +1132,7 @@ static int kcm_recvmsg(struct socket *sock, struct > msghdr *msg, > > lock_sock(sk); > > - skb = kcm_wait_data(sk, flags, timeo, &err); > + skb = kcm_wait_data(sk, flags, peek, timeo, &err); > if (!skb) > goto out; > Because kcm_wait_data() potentially unlinks now, you will have to kfree the SKB in the error paths, for example if skb_copy_datagram_msg() fails. Otherwise we have an SKB leak. Yeah, it's kind of ugly that kcm_recvmsg() is going to become a pile of conditional operations based upon the peek boolean. :-/