init/main.c question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm making a small project out of going through the linux boot code and trying 
to figure out how it all works.  In init/init.c, line 717, there is the 
following rather odd bunch of code:

         */
        if (sys_access((const char __user *) "/init", 0) == 0)
                execute_command = "/init";
        else
                prepare_namespace();

It looks like if the file "/init" exists, it overrides any init= command line, 
and skips trying to do the initial mounts.  I imagine there must be a good 
reason for this, but I can't quite figure out what it is.  My first thought 
is that it's for embedded systems.  Anyone able to shed some light on that?

It also looks to be either a security help or a great way to shoot yourself in 
the foot...

--Russell


-- 

Russell Miller - rmiller@xxxxxxxxxxxx - Le Mars, IA
Duskglow Consulting - Helping companies just like you to succeed for ~ 10 yrs.
http://www.duskglow.com - 712-546-5886

--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux