Re: [PATCH 2/8] btrfs: do not init a reloc root if we aren't relocating

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

 



On 3/4/20 1:44 PM, Nikolay Borisov wrote:


On 4.03.20 г. 18:18 ч., Josef Bacik wrote:
We previously were checking if the root had a dead root before accessing
root->reloc_root in order to avoid a UAF type bug.  However this
scenario happens after we've unset the reloc control, so we would have
been saved if we'd simply checked for fs_info->reloc_control.  At this
point during relocation we no longer need to be creating new reloc
roots, so simply move this check above the reloc_root checks to avoid
any future races and confusion.

Signed-off-by: Josef Bacik <josef@xxxxxxxxxxxxxx>


Doesn't this patch essentially obviate the reloc_root_is_dead. W.r.t
->reloc_ctl it's important to note that it's being set under reloc_mutex
which this function is also called under so we are guaranteed consistent
value.


Yes it does, but I want to keep the cleanups separate from the fixes. I threw this in here because it's more of a correctness/fix than a cleanup. Thanks,

Josef



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux