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: <6a9819fe-b1cc-63fe-6ab3-32a4fbe7f16f@rasmusvillemoes.dk>
Date:   Wed, 28 Jul 2021 13:49:16 +0200
From:   Rasmus Villemoes <linux@...musvillemoes.dk>
To:     Alexander Egorenkov <egorenar@...ux.ibm.com>
Cc:     akpm@...ux-foundation.org, bp@...en8.de, corbet@....net,
        gregkh@...uxfoundation.org, jeyu@...nel.org,
        linux-kernel@...r.kernel.org, mcgrof@...nel.org,
        ndesaulniers@...gle.com, torvalds@...ux-foundation.org,
        Bruno Goncalves <bgoncalv@...hat.com>,
        Dave Young <dyoung@...hat.com>
Subject: Re: [PATCH v3 1/2] init/initramfs.c: do unpacking asynchronously

On 28/07/2021 12.36, Alexander Egorenkov wrote:
> Rasmus Villemoes <linux@...musvillemoes.dk> writes:
> 
>> On 24/07/2021 09.46, Alexander Egorenkov wrote:
>>> Hello,
>>>
>>> since e7cb072eb988 ("init/initramfs.c: do unpacking asynchronously"), we
>>> started seeing the following problem on s390 arch regularly:
>>>
>>> [    5.039734] wait_for_initramfs() called before rootfs_initcalls
>>
>> While that message was added as part of the same patch, it's a red
>> herring: It merely means that something ends up calling usermodehelper
>> (perhaps a request_module) before the init sequence has come around to
>> rootfs_initcalls. At that point, the rootfs is (with or without my async
>> patch) entirely empty, so those usermodehelper calls have always failed
>> with -ENOENT.
>>
>> If you have CONFIG_UEVENT_HELPER=y and CONFIG_UEVENT_HELPER_PATH set to
>> a non-empty string, you can try setting the latter to the empty string.
>> But the message won't go away if it's really a request_module() and not
>> a uevent notification.
>>
> 
> Thanks for the helpful explanation. I disabled UEVENT on my test machine and
> as you said, the message is being triggered by request_module() now.

Yes. But as I've said, the "called before rootfs_initcalls" message is
entirely harmless and not in any way related to whatever problems is
later encountered when the initramfs is actually being decompressed and
extracted.

I have this so far untested patch that I plan on sending, which should
remove that message

diff --git a/init/initramfs.c b/init/initramfs.c
index af27abc59643..51a686a8c929 100644
--- a/init/initramfs.c
+++ b/init/initramfs.c
@@ -727,6 +727,7 @@ static int __init populate_rootfs(void)
 {
        initramfs_cookie = async_schedule_domain(do_populate_rootfs, NULL,
                                                 &initramfs_domain);
+       usermodehelper_enable();
        if (!initramfs_async)
                wait_for_initramfs();
        return 0;
diff --git a/init/main.c b/init/main.c
index f5b8246e8aa1..d5c5542fe142 100644
--- a/init/main.c
+++ b/init/main.c
@@ -1387,7 +1387,6 @@ static void __init do_basic_setup(void)
        driver_init();
        init_irq_proc();
        do_ctors();
-       usermodehelper_enable();
        do_initcalls();
 }

diff --git a/init/noinitramfs.c b/init/noinitramfs.c
index 3d62b07f3bb9..f1d9e5495cc1 100644
--- a/init/noinitramfs.c
+++ b/init/noinitramfs.c
@@ -18,6 +18,7 @@ static int __init default_rootfs(void)
 {
        int err;

+       usermodehelper_enable();
        err = init_mkdir("/dev", 0755);
        if (err < 0)
                goto out;

because any call of a usermodehelper (be it a uevent hotplug
notification or a request_module) would just return -EBUSY during all
pure_, core_, postcore_, arch_, subsys_ and fs_ initcalls. (It is really
beyond me why rootfs_ initcalls are hidden between fs_ and device_
initcalls).

Currently (with or without my async patch) umh calls from those
initcalls probably return -ENOENT or whatever kernel_execve() returns
when there's no such binary. So if something actually looks at the
return value, the change from -ENOENT to -EBUSY might cause a
regression. But I doubt it.

Rasmus

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ