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]
Message-ID: <m1vcopajxy.fsf@fess.ebiederm.org>
Date:	Thu, 05 Jan 2012 14:00:41 -0800
From:	ebiederm@...ssion.com (Eric W. Biederman)
To:	Richard Weinberger <richard@....at>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	a.p.zijlstra@...llo.nl, mingo@...e.hu, xiyou.wangcong@...il.com
Subject: Re: [PATCH] init: Warn on non-existent rdinit

Richard Weinberger <richard@....at> writes:

> Am 05.01.2012 21:53, schrieb Eric W. Biederman:
>> Richard Weinberger <richard@....at> writes:
>> 
>>> Such a warning would have saved me some time...
>>> Hopefully this printk() saves someone else's time. :-)
>> 
>> The warning is wrong if you are not using an initramfs or an initial
>> ramdisk.
>
> Gnah, you're so right.
> I did not test it without a ramdisk.
>
>> I expect what you want is something like:
>> 
>> diff --git a/init/main.c b/init/main.c
>> index 217ed23..8d53d28 100644
>> --- a/init/main.c
>> +++ b/init/main.c
>> @@ -830,10 +830,11 @@ static int __init kernel_init(void * unused)
>>          * the work
>>          */
>>  
>> -       if (!ramdisk_execute_command)
>> +       if (!ramdisk_execute_command &&
>> +           (sys_access((const char __user *)"/init", 0) == 0))
>>                 ramdisk_execute_command = "/init";
>>  
>> -       if (sys_access((const char __user *) ramdisk_execute_command, 0) != 0) {
>> +       if (!ramdisk_execute_command) {
>>                 ramdisk_execute_command = NULL;
>>                 prepare_namespace();
>>         }
>
> Why ramdisk_execute_command = NULL; in the !ramdisk_execute_command
> case?

Because in my untested patch I didn't get as far as deleting that line.

>> That way we don't clear ramdisk_execute_command if it was set and
>> we complain if we attempt exec the ramdisk_execute_command.
>
> If "/init" does not exist we still don't get a warning.

Perhaps it has a /linuxrc.  If you can find a way of figuring out we
always need the file we can print an error.  Otherwise it is a case of
the kernel auto-detecting what to do, and not printing a warning when it
has decided there is no /init to play with.

Eric
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ