init applet uses "nit" identity in syslog instead of "init"

Deweloper deweloper at
Tue Feb 25 00:03:10 UTC 2020


I noticed a side effect of FEATURE_INIT_MODIFY_CMDLINE combined with

<6>[    0.823290] Run /init as init process
<30>[    3.800792] nit: reloading /etc/inittab
<30>[579213.077839] nit: reloading /etc/inittab
<30>[579214.078785] nit: process '/sbin/getty -L 9600 tty0' (pid 263) exited.
Scheduling for restart.

This seemingly harmless problem is probably caused by using a stale pointer to
argv[0] kept inside "applet_name"; init applet overwrites that part of memory
and then it passes the old pointer to openlog.

Fortunately there is an option to disable FEATURE_INIT_MODIFY_CMDLINE, what is
probably the right solution, but in case this option is going to be kept
enabled by default - shouldn't the init applet be responsible for avoiding any
side effects of the suspicious operation it performs?

BTW. busybox doesn't link after "make allnoconfig" and enabling just
"init" applet in "make menuconfig":

/usr/bin/ld: shell/lib.a(ash.o): in function `evalcommand':
ash.c:(.text.evalcommand+0xba): undefined reference to `fill_arglist'
/usr/bin/ld: ash.c:(.text.evalcommand+0x173): undefined reference to
`parse_command_args' collect2: error: ld returned 1 exit status

More information about the busybox mailing list