Re: [PATCH 3/8] btrfs: Switch to iomap_dio_rw() for dio

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Dec 12, 2019 at 10:56:48AM +0100, Johannes Thumshirn wrote:
> On 12/12/2019 10:49, Christoph Hellwig wrote:
> >> @@ -8230,9 +8228,8 @@ static void btrfs_endio_direct_read(struct bio *bio)
> >>  	kfree(dip);
> >>  
> >>  	dio_bio->bi_status = err;
> >> -	dio_end_io(dio_bio);
> >> +	bio_endio(dio_bio);
> >>  	btrfs_io_bio_free_csum(io_bio);
> >> -	bio_put(bio);
> > 
> > I'm not a btrfs export, but doesn't this introduce a use after free
> > as bio_endio also frees io_bio?
> 
> No that's ok, as the bio_endio() frees the dio_bio, while
> btrfs_io_bio_free_csum() frees the csum of the io_bio (which is a struct
> btrfs_io_bio).

So who frees the io_bio and its embedded bio?



[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]

  Powered by Linux