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  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, 13 May 2019 21:37:16 -0400
From:   Mike Snitzer <>
To:     Helen Koike <>
Cc:,,, Alasdair Kergon <>
Subject: Re: dm ioctl: fix hang in early create error condition

On Mon, May 13 2019 at  3:25P -0400,
Helen Koike <> wrote:

> The dm_early_create() function (which deals with "dm-mod.create=" kernel
> command line option) calls dm_hash_insert() who gets an extra reference
> to the md object.
> In case of failure, this reference wasn't being released, causing
> dm_destroy() to hang, thus hanging the whole boot process.
> Fix this by calling __hash_remove() in the error path.
> Fixes: 6bbc923dfcf57d ("dm: add support to directly boot to a mapped device")
> Cc:
> Signed-off-by: Helen Koike <>
> ---
> Hi,
> I tested this patch by adding a new test case in the following test
> script:
> This test was failing, but with this patch it works correctly.
> Thanks
> Helen

Thanks for the patch but I'd prefer the following simpler fix.  What do
you think?

That said, I can provide a follow-on patch (inspired by the patch you
provided) that encourages more code sharing between dm_early_create()
and dev_create() by factoring out __dev_create().

diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c
index c740153b4e52..0eb0b462c736 100644
--- a/drivers/md/dm-ioctl.c
+++ b/drivers/md/dm-ioctl.c
@@ -2117,6 +2117,7 @@ int __init dm_early_create(struct dm_ioctl *dmi,
+	(void) __hash_remove(__find_device_hash_cell(dmi));
 	return r;

Powered by blists - more mailing lists