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] [day] [month] [year] [list]
Message-ID: <CAPhsuW5NSeCfMkx-6MmW-am1BSVfAo9zg0aF_P9ZqVhmnmPnpQ@mail.gmail.com>
Date:   Mon, 21 Aug 2023 20:12:18 -0700
From:   Song Liu <song@...nel.org>
To:     Yu Kuai <yukuai1@...weicloud.com>
Cc:     xni@...hat.com, linux-raid@...r.kernel.org,
        linux-kernel@...r.kernel.org, yi.zhang@...wei.com,
        yangerkun@...wei.com, "yukuai (C)" <yukuai3@...wei.com>
Subject: Re: [PATCH -next 3/7] md: don't rely on 'mddev->pers' to be set in mddev_suspend()

On Mon, Aug 21, 2023 at 7:08 PM Yu Kuai <yukuai1@...weicloud.com> wrote:
>
> Hi,
>
> 在 2023/08/22 8:13, Song Liu 写道:
> > On Thu, Aug 3, 2023 at 6:30 AM Yu Kuai <yukuai1@...weicloud.com> wrote:
> >>
> >> From: Yu Kuai <yukuai3@...wei.com>
> >>
> >> Now that active io is initialized when mddev is allocated, it's safe to
> >> call mddev_suspend() before 'mddev->pers' is set.
> >>
> >> This also prevent null-ptr-def in some cases that caller doesn't
> >> guarantee 'mddev->pers' to be set.
> >
> > This description is a little confusing (to me at least). Please revise it.
>
> Sorry about this, how about this:
>
> 'active_io' used to be initialized while the array is running, and
> 'mddev->pers' is set while the array is running as well. Hence caller
> must hold 'reconfig_mutex' and guarantee 'mddev->pers' is set before
> calling mddev_suspend().
>
> Now that 'active_io' is initialized when mddev is allocated, such
> restriction doesn't exist anymore. In the meantime, follow up patches
> will refactor mddev_suspend(), hence add checking for 'mddev->pers' to
> prevent null-ptr-deref.

This is much better. Thanks!

Song

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ