Skip to content

Commit

Permalink
revert "net: kcm: fix memory leak in kcm_sendmsg"
Browse files Browse the repository at this point in the history
In commit c47cc30 ("net: kcm: fix memory leak in kcm_sendmsg")
I misunderstood the root case of the memory leak and came up with
completely broken fix.

So, simply revert this commit to avoid GPF reported by
syzbot.

Im so sorry for this situation.

Fixes: c47cc30 ("net: kcm: fix memory leak in kcm_sendmsg")
Reported-by: syzbot+65badd5e74ec62cb67dc@syzkaller.appspotmail.com
Signed-off-by: Pavel Skripkin <paskripkin@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Pavel Skripkin authored and David S. Miller committed Jun 7, 2021
1 parent aaab307 commit a47c397
Showing 1 changed file with 0 additions and 5 deletions.
5 changes: 0 additions & 5 deletions net/kcm/kcmsock.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,11 +1066,6 @@ static int kcm_sendmsg(struct socket *sock, struct msghdr *msg, size_t len)
goto partial_message;
}

if (skb_has_frag_list(head)) {
kfree_skb_list(skb_shinfo(head)->frag_list);
skb_shinfo(head)->frag_list = NULL;
}

if (head != kcm->seq_skb)
kfree_skb(head);

Expand Down

0 comments on commit a47c397

Please sign in to comment.