Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Jason Wang
On 2018年05月16日 15:40, Andrei Vagin wrote: On Wed, May 16, 2018 at 03:32:59PM +0800, Jason Wang wrote: On 2018年05月16日 15:12, Andrei Vagin wrote: Hi Jason, I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". Pls take a look at the attached patch. Yes. It looks to me

Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Andrei Vagin
On Wed, May 16, 2018 at 03:32:59PM +0800, Jason Wang wrote: > > > On 2018年05月16日 15:12, Andrei Vagin wrote: > > Hi Jason, > > > > I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". > > > > Pls take a look at the attached patch. > > Yes. > > It looks to me it's not nec

Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Jason Wang
On 2018年05月16日 15:12, Andrei Vagin wrote: Hi Jason, I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". Pls take a look at the attached patch. Yes. It looks to me it's not necessary to take extra refcnt during release, we can just do the cleanup at __tun_detach().

Re: linux-next: BUG: KASAN: use-after-free in tun_chr_close

2018-05-16 Thread Andrei Vagin
Hi Jason, I think the problem is in "tun: hold a tun socket during ptr_ring_cleanup". Pls take a look at the attached patch. On Tue, May 15, 2018 at 11:28:25PM -0700, Andrei Vagin wrote: > We run CRIU tests on linux-next regularly and today we caught this bug: > > https://travis-ci.org/avagin/