Re: [PATCH] bdi: fix use-after-free for bdi device

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

 



Hello, Jan.

On Wed, Feb 19, 2020 at 01:55:05PM +0100, Jan Kara wrote:
> Also I was wondering about one thing: If we really care about bdi->dev only
> for the name, won't we be much better off with just copying the name to
> bdi->name on registration? Sure it would consume a bit of memory for the
> name copy but I don't think we really care and things would be IMO *much*
> simpler that way... Yufen, Tejun, what do you think?

Yeah, could be. So, object lifetimes in block layer have been kinda
janky mostly for historical reasons and in a lot of cases ppl apply
bandaids to work around immediate problems and at other times things
get restructured and properly fixed. Given how the objects are used
here, it'd be a typical case for RCU protecting bdi->dev and I wonder,
in the longer term, that'd be a better way to go than special-casing
name. That said, it's not a strong opinion.

Thanks.

-- 
tejun



[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