revert "net: kcm: fix memory leak in kcm_sendmsg"
authorPavel Skripkin <paskripkin@gmail.com>
Mon, 7 Jun 2021 18:46:23 +0000 (21:46 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 7 Jun 2021 20:34:37 +0000 (13:34 -0700)
In commit c47cc304990a ("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: c47cc304990a ("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>
net/kcm/kcmsock.c

index 1c572c8daced03951491d5b2da667f6992d5f835..6201965bd822f0cef1f8716c26e28e7bc915701d 100644 (file)
@@ -1066,11 +1066,6 @@ out_error:
                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);