Commit 8432b81
vsock/virtio: free queued packets when closing socket
As reported by syzbot [1], there is a memory leak while closing the
socket. We partially solved this issue with commit ac03046
("vsock/virtio: free packets during the socket release"), but we
forgot to drain the RX queue when the socket is definitely closed by
the scheduled work.
To avoid future issues, let's use the new virtio_transport_remove_sock()
to drain the RX queue before removing the socket from the af_vsock lists
calling vsock_remove_sock().
[1] https://syzkaller.appspot.com/bug?extid=24452624fc4c571eedd9
Fixes: ac03046 ("vsock/virtio: free packets during the socket release")
Reported-and-tested-by: syzbot+24452624fc4c571eedd9@syzkaller.appspotmail.com
Signed-off-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>1 parent eeddfd8 commit 8432b81
1 file changed
+19
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
733 | 733 | | |
734 | 734 | | |
735 | 735 | | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
| 746 | + | |
| 747 | + | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
| 751 | + | |
| 752 | + | |
736 | 753 | | |
737 | 754 | | |
738 | 755 | | |
| |||
765 | 782 | | |
766 | 783 | | |
767 | 784 | | |
768 | | - | |
| 785 | + | |
769 | 786 | | |
770 | 787 | | |
771 | 788 | | |
| |||
828 | 845 | | |
829 | 846 | | |
830 | 847 | | |
831 | | - | |
832 | | - | |
833 | 848 | | |
834 | 849 | | |
835 | 850 | | |
836 | 851 | | |
837 | 852 | | |
838 | 853 | | |
839 | | - | |
840 | | - | |
841 | | - | |
842 | | - | |
843 | | - | |
844 | 854 | | |
845 | 855 | | |
846 | | - | |
| 856 | + | |
847 | 857 | | |
848 | 858 | | |
849 | 859 | | |
| |||
0 commit comments