Re: [PATCH] block: fix memleak of bio integrity data

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

 



On Wed, Dec 04, 2019 at 09:41:24PM -0800, Justin Tee wrote:
> Hi Ming,
> 
> I understand the patch, but I have a concern.
> 
> Is it possible to come across a double-free?  from bio_endio ->
> bio_integrity_endio -> __bio_integrity_endio -> bio_integrity_free;  And
> then, resuming in bio_endio -> bio_uninit -> bio_integrity_free;.  Maybe
> it's even possible queue_work  bio_integrity_verify_fn was scheduled and
> called bio_integrity_free from there as well.  So, should also remove
> bio_integrity_free from bio_integrity_verify_fn and __bio_integrity_endio
> routines?

Yeah, double-free could be caused for READ between bio_integrity_verify_fn()
and bio_uninit().

I think it is enough to remove bio_integrity_free() from both
bio_integrity_verify_fn() and __bio_integrity_endio().

Will do it in V2.


Thanks, 
Ming





[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux