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:   Tue, 14 Mar 2023 10:11:13 +0100
From:   Mariusz Tkaczyk <mariusz.tkaczyk@...ux.intel.com>
To:     "NeilBrown" <neilb@...e.de>
Cc:     Jes Sorensen <jes@...ined-monkey.org>,
        "Song Liu" <song@...nel.org>,
        "Linux regressions mailing list" <regressions@...ts.linux.dev>,
        "linux-raid" <linux-raid@...r.kernel.org>,
        "LKML" <linux-kernel@...r.kernel.org>,
        "Nikolay Kichukov" <hijacker@...um.net>
Subject: Re: [PATCH - mdadm] mdopen: always try create_named_array()

On Tue, 14 Mar 2023 11:06:25 +1100
"NeilBrown" <neilb@...e.de> wrote:

> mdopen() will use create_named_array() to ask the kernel to create the
> given md array, but only if it is given a number or name.
> If it is NOT given a name and is required to choose one itself using
> find_free_devnm() it does NOT use create_named_array().
> 
> On kernels with CONFIG_BLOCK_LEGACY_AUTOLOAD not set, this can result in
> failure to assemble an array.  This can particularly seen when the
> "name" of the array begins with a host name different to the name of the
> host running the command.
> 
> So add the missing call to create_named_array().
> 
> Link: https://bugzilla.kernel.org/show_bug.cgi?id=217074
> Signed-off-by: NeilBrown <neilb@...e.de>
> ---
>  mdopen.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/mdopen.c b/mdopen.c
> index d18c931996d2..810f79a3d19a 100644
> --- a/mdopen.c
> +++ b/mdopen.c
> @@ -370,6 +370,7 @@ int create_mddev(char *dev, char *name, int autof, int
> trustworthy, }
>  		if (block_udev)
>  			udev_block(devnm);
> +		create_named_array(devnm);
>  	}
>  
>  	sprintf(devname, "/dev/%s", devnm);

Hi Neil,
Thanks for handling that. I didn't have time to get into this topic yet.
I trust you and I believe that it is a good fix but I cannot verify it by
standard code review- the code is to complex. Could you please add test for it
to prove it works this way at least for following cases?
- mdadm -CR /dev/md/name
- mdadm -CR name
- mdadm -CR /dev/md_name
- mdadm -CR /dev/mdX, where X is a number.

You can disable creation via open temporarily by changing value in
/sys/module/md_mod/parameters/new_array that should be enough for verification.

For code:
Acked-by: Mariusz Tkaczyk <mariusz.tkaczyk@...ux.intel.com>

Thanks,
Mariusz

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ