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: <CALTww29m_RQHbZY6owX2y1_rmOeCEL9rSWg4=shnnitA1RpWQg@mail.gmail.com>
Date:   Wed, 13 Oct 2021 15:57:57 +0800
From:   Xiao Ni <xni@...hat.com>
To:     Li Feng <fengli@...rtx.com>
Cc:     Song Liu <song@...nel.org>,
        "open list:SOFTWARE RAID (Multiple Disks) SUPPORT" 
        <linux-raid@...r.kernel.org>,
        open list <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH RESEND] md: allow to set the fail_fast on RAID1/RAID10

On Tue, Oct 12, 2021 at 5:14 PM Li Feng <fengli@...rtx.com> wrote:
> >          sysfs_notify_dirent_safe(rdev->sysfs_state);
> > +    if (need_update_sb)
> > +        if (mddev->pers) {
> > +            set_bit(MD_SB_CHANGE_DEVS, &mddev->sb_flags);
> > +            md_wakeup_thread(mddev->thread);
> > +        }
> When will mddev->pers is NULL?

The process of creating a raid device is:
1. md_ioctl->md_add_new_disk
2. md_ioctl->do_md_run->md_run->(pers->run)->(mddev->pers = pers)
In md_add_new_disk it creates the per device sysfs files. It can
read/write these
files before setting mddev->pers.

> If it is NULL, this change will not on disk.

I did a test. You are right. Someone can change the per device state
before ADD_NEW_DISK
and RUN_ARRAY ioctl. Please note, the mdadm --create command doesn't
return until RUN_ARRAY
ioctl finishes. Even though the are small, we can try to set MD_SB_CHANGE_DEVS.

Best regards
Xiao

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ