Re: [Patch net] tun: fix a memory leak for tfile->tx_array

2018-01-10 Thread Cong Wang
On Tue, Jan 9, 2018 at 7:00 PM, Jason Wang wrote: > > > On 2018年01月10日 08:07, Cong Wang wrote: >> >> tfile->tun could be detached before we close the tun fd, >> via tun_detach_all(), so it should not be used to check for >> tfile->tx_array. >> >> Use the same logic as in

Re: [Patch net] tun: fix a memory leak for tfile->tx_array

2018-01-09 Thread Jason Wang
On 2018年01月10日 08:07, Cong Wang wrote: tfile->tun could be detached before we close the tun fd, via tun_detach_all(), so it should not be used to check for tfile->tx_array. Use the same logic as in tun_attach(), just test !tfile->deatched. Reported-by: Dmitry Vyukov

[Patch net] tun: fix a memory leak for tfile->tx_array

2018-01-09 Thread Cong Wang
tfile->tun could be detached before we close the tun fd, via tun_detach_all(), so it should not be used to check for tfile->tx_array. Use the same logic as in tun_attach(), just test !tfile->deatched. Reported-by: Dmitry Vyukov Fixes: 1576d9860599 ("tun: switch to use skb