lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d929eaa7-61d6-c4c4-aabc-0124c3693e10@huaweicloud.com>
Date:   Tue, 18 Jul 2023 09:37:33 +0800
From:   Yu Kuai <yukuai1@...weicloud.com>
To:     Sergei Shtepa <sergei.shtepa@...am.com>,
        Yu Kuai <yukuai1@...weicloud.com>, axboe@...nel.dk,
        hch@...radead.org, corbet@....net, snitzer@...nel.org
Cc:     viro@...iv.linux.org.uk, brauner@...nel.org, dchinner@...hat.com,
        willy@...radead.org, dlemoal@...nel.org, linux@...ssschuh.net,
        jack@...e.cz, ming.lei@...hat.com, linux-block@...r.kernel.org,
        linux-doc@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-fsdevel@...r.kernel.org,
        Donald Buczek <buczek@...gen.mpg.de>,
        "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH v5 02/11] block: Block Device Filtering Mechanism

Hi,

在 2023/07/17 22:39, Sergei Shtepa 写道:
> 
> 
> On 7/11/23 04:02, Yu Kuai wrote:
>> bdev_disk_changed() is not handled, where delete_partition() and
>> add_partition() will be called, this means blkfilter for partiton will
>> be removed after partition rescan. Am I missing something?
> 
> Yes, when the bdev_disk_changed() is called, all disk block devices
> are deleted and new ones are re-created. Therefore, the information
> about the attached filters will be lost. This is equivalent to
> removing the disk and adding it back.
> 
> For the blksnap module, partition rescan will mean the loss of the
> change trackers data. If a snapshot was created, then such
> a partition rescan will cause the snapshot to be corrupted.
> 

I haven't review blksnap code yet, but this sounds like a problem.

possible solutions I have in mind:

1. Store blkfilter for each partition from bdev_disk_changed() before
delete_partition(), and add blkfilter back after add_partition().

2. Store blkfilter from gendisk as a xarray, and protect it by
'open_mutex' like 'part_tbl', block_device can keep the pointer to
reference blkfilter so that performance from fast path is ok, and the
lifetime of blkfiter can be managed separately.

> There was an idea to do filtering at the disk level,
> but I abandoned it.
> .
> 
I think it's better to do filtering at the partition level as well.

Thanks,
Kuai

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ