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]
Date:   Mon, 31 Jul 2023 07:49:51 +0200
From:   Paul Menzel <pmenzel@...gen.mpg.de>
To:     Yu Kuai <yukuai1@...weicloud.com>
Cc:     song@...nel.org, yukuai3@...wei.com, linux-raid@...r.kernel.org,
        linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
        yangerkun@...wei.com
Subject: Re: [PATCH -next] md/raid10: fix a 'conf->barrier' leakage in
 raid10_takeover()

Dear Yu,


Thank you for your patch. Some minor style comments for the commit 
message, you can also ignore.

Am 31.07.23 um 04:28 schrieb Yu Kuai:
> From: Yu Kuai <yukuai3@...wei.com>
> 
> After commit 4d27e927344a ("md: don't quiesce in mddev_suspend()"),
> 'conf->barrier' will be leaked in the case that raid10 takeover raid0:
> 
> level_store
>   pers->takeover -> raid10_takeover
>    raid10_takeover_raid0
>     WRITE_ONCE(conf->barrier, 1)
> 
> mddev_suspend
> // still raid0
> mddev->pers = pers
> // switch to raid10
> mddev_resume
> // resume without suspend
> 
> After the above commit, mddev_resume() will not decrease 'conf->barrier'
> that is set in raid10_takeover_raid0().
> 
> Fix this problem by remove the setting of 'conf->barrier' from

removing

or

… by not setting `conf->barrier` in …

> raid10_takeover_raid0().
> 
> By the way, this problem is found while I'm trying to make
> mddev_suspend/resume() to be independent from raid personalities. rai10

rai*d*

> is the only personality to use reference count in the quiesce() callback
> and this problem is only related to raid10.
> 
> Fixes: 4d27e927344a ("md: don't quiesce in mddev_suspend()")
> Signed-off-by: Yu Kuai <yukuai3@...wei.com>
> ---
>   drivers/md/raid10.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
> index 16aa9d735880..7704a4c7f469 100644
> --- a/drivers/md/raid10.c
> +++ b/drivers/md/raid10.c
> @@ -4417,7 +4417,6 @@ static void *raid10_takeover_raid0(struct mddev *mddev, sector_t size, int devs)
>   				rdev->new_raid_disk = rdev->raid_disk * 2;
>   				rdev->sectors = size;
>   			}
> -		WRITE_ONCE(conf->barrier, 1);
>   	}
>   
>   	return conf;

Reviewed-by: Paul Menzel <pmenzel@...gen.mpg.de>


Kind regards,

Paul

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ