blob: 063d7cd48359407cd8fd685dfee3a9ee6ea0ae84 [file] [log] [blame]
Denys Vlasenko819b47a2017-08-03 03:29:32 +02001Why an applet can't be NOFORK or NOEXEC?
2
3Why can't be NOFORK:
Denys Vlasenko819b47a2017-08-03 03:29:32 +02004interactive: may wait for user input, ^C has to work
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +02005spawner: "tool PROG ARGS" which changes program state and execs - must fork
Denys Vlasenko819b47a2017-08-03 03:29:32 +02006changes state: e.g. environment, signal handlers
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +02007leaks: does not free allocated memory or opened fds
Denys Vlasenko1a1203f2017-08-07 16:47:34 +02008 alloc+xfunc: xmalloc, then xfunc - leaks memory if xfunc dies
9 open+xfunc: opens fd, then calls xfunc - fd is leaked if xfunc dies
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +020010talks to network/serial/etc: it's not known how long the delay can be,
11 it's reasonable to expect it might be many seconds
12 (even if usually it is not), so ^C has to work
Denys Vlasenko39194f02017-08-03 19:00:01 +020013runner: sometimes may run for long(ish) time, and/or works with network:
Denys Vlasenko819b47a2017-08-03 03:29:32 +020014 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc)
15
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020016"runners" can become eligible after shell is taught ^C to interrupt NOFORKs,
Denys Vlasenko74c05f52017-08-04 17:36:16 +020017need to be inspected that they do not fall into alloc+xfunc, open+xfunc,
18leak categories.
Denys Vlasenko819b47a2017-08-03 03:29:32 +020019
20Why can't be NOEXEC:
21suid: runs under different uid - must fork+exec
Denys Vlasenko248a67f2017-08-07 18:18:09 +020022if it's important that /proc/PID/cmdline and comm are correct.
23 ("pkill sh" killing itself before it kills real "sh" is no fun)
Denys Vlasenko819b47a2017-08-03 03:29:32 +020024
25Why shouldn't be NOFORK/NOEXEC:
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020026rare: not started often enough to bother optimizing (example: poweroff)
27daemon: runs indefinitely; these are also always fit "rare" category
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020028longterm: often runs for a long time (many seconds), execing makes
Denys Vlasenko39194f02017-08-03 19:00:01 +020029 memory footprint smaller
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020030complex: no immediately obvious reason why NOFORK wouldn't work,
Denys Vlasenko74c05f52017-08-04 17:36:16 +020031 but does some non-obvoius operations (example: fuser, lsof, losetup);
32 detailed audit often turns out that it's a leaker
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020033hardware: performs unusual hardware ops which may take long,
34 or even hang due to hardware or firmware bugs
Denys Vlasenko74c05f52017-08-04 17:36:16 +020035
36Interesting example of "interactive" applet which is nevertheless can be
37(and is) NOEXEC is "rm". Yes, "rm -i" is interactive - but it's not that typical
38for users to keep it waiting for many minutes, whereas running "rm" in shell
39is very typical, and speeding up this common use via NOEXEC is useful.
40IOW: rm is "interactive", but not "longterm".
41
Denys Vlasenko819b47a2017-08-03 03:29:32 +020042
43[ - NOFORK
44[[ - NOFORK
45acpid - daemon
Denys Vlasenko7b8372b2017-08-07 00:28:15 +020046add-shell - noexec. leaks: open+xfunc
47addgroup - noexec. leaks
48adduser - noexec. leaks
Denys Vlasenkoed7d1182017-08-06 20:00:21 +020049adjtimex - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +020050ar - runner
51arch - NOFORK
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +020052arp - talks to network: arp -n queries DNS
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020053arping - longterm
Denys Vlasenko74c05f52017-08-04 17:36:16 +020054ash - interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +020055awk - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020056base64 - runner
57basename - NOFORK
Denys Vlasenko035e7152017-08-06 20:39:27 +020058beep - longterm: beep -r 999999999
Denys Vlasenko277081e2017-08-06 20:20:47 +020059blkdiscard - noexec. leaks: open+xioctl
Denys Vlasenkobf182392017-08-06 20:16:28 +020060blkid - noexec
Denys Vlasenko9f598492017-08-05 01:29:12 +020061blockdev - noexec. leaks fd
Denys Vlasenko819b47a2017-08-03 03:29:32 +020062bootchartd - daemon
Denys Vlasenko86e07f62017-08-06 20:14:02 +020063brctl - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +020064bunzip2 - runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020065bzcat - runner
66bzip2 - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +020067cal - runner: cal -n9999
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +020068cat - runner: cat HUGEFILE
69chat - longterm (when used as intended - talking to modem over stdin/out)
Denys Vlasenko99125c02017-08-05 20:38:04 +020070chattr - noexec. runner
Denys Vlasenko39194f02017-08-03 19:00:01 +020071chgrp - noexec. runner
72chmod - noexec. runner
73chown - noexec. runner
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +020074chpasswd - longterm? (list of "user:password"s from stdin)
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020075chpst - noexec. spawner
76chroot - noexec. spawner
77chrt - noexec. spawner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +020078chvt - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenko39194f02017-08-03 19:00:01 +020079cksum - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020080clear - NOFORK
81cmp - runner
82comm - runner
Denys Vlasenko83d77852017-08-04 17:59:46 +020083conspy - interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +020084cp - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020085cpio - runner
86crond - daemon
Denys Vlasenko22627462017-08-06 17:14:09 +020087crontab - longterm (runs $EDITOR), leaks: open+xasprintf
Denys Vlasenkofeb79e82017-08-05 02:08:23 +020088cryptpw - noexec. changes state: with --password-fd=N, moves N to stdin
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020089cttyhack - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +020090cut - noexec. runner
91date - noexec. nofork candidate(needs to stop messing up env, free xasprintf result, not use xfuncs after xasprintf)
Denys Vlasenkodbbc3f22017-08-07 23:30:22 +020092dc - longterm (eats stdin if no params)
Denys Vlasenko39194f02017-08-03 19:00:01 +020093dd - noexec. runner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +020094deallocvt - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenko7b8372b2017-08-07 00:28:15 +020095delgroup - noexec. leaks
96deluser - noexec. leaks
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020097depmod - longterm(ish)
Denys Vlasenkofc9efcb2017-08-07 22:19:17 +020098devmem - hardware (access to device memory may hang)
99df - noexec. leaks: nested allocs
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200100dhcprelay - daemon
101diff - runner
102dirname - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200103dmesg - runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200104dnsd - daemon
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +0200105dnsdomainname - noexec. talks to network (may query DNS)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200106dos2unix - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200107dpkg - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200108du - runner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200109dumpkmap - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenkodbbc3f22017-08-07 23:30:22 +0200110dumpleases - noexec. leaks: open+xread
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200111echo - NOFORK
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200112ed - interactive, longterm
113egrep - longterm runner ("CMD | egrep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenkoaf5d0082017-08-07 23:23:18 +0200114eject - hardware, leaks: open+ioctl_or_perror_and_die, changes state (moves fds)
Denys Vlasenko83d77852017-08-04 17:59:46 +0200115env - noexec. spawner, changes state (env)
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200116envdir - noexec. spawner
117envuidgid - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200118expand - runner
Denys Vlasenkoaf5d0082017-08-07 23:23:18 +0200119expr - noexec. leaks: nested allocs
Denys Vlasenkodbbc3f22017-08-07 23:30:22 +0200120factor - longterm (eats stdin if no params)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200121fakeidentd - daemon
122false - NOFORK
Denys Vlasenko354b1042017-08-07 22:21:54 +0200123fatattr - noexec. leaks: open+xioctl, complex
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200124fbset - hardware, leaks: open+xfunc
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200125fbsplash - runner, longterm
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200126fdflush - hardware, leaks: open+ioctl_or_perror_and_die
Denys Vlasenko8858a982017-08-08 01:21:49 +0200127fdformat - hardware, longterm
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200128fdisk - interactive, longterm
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200129fgconsole - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200130fgrep - longterm runner ("CMD | fgrep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200131find - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200132findfs - suid
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200133flash_eraseall - hardware
134flash_lock - hardware
135flash_unlock - hardware
136flashcp - hardware
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200137flock - spawner, changes state (file locks), let's play safe and not be noexec
Denys Vlasenko39194f02017-08-03 19:00:01 +0200138fold - noexec. runner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200139free - noexec. nofork candidate(struct globals, needs to close /proc/meminfo fd)
Denys Vlasenkoec98e3a2017-08-07 23:17:14 +0200140freeramdisk - noexec. leaks: open+ioctl_or_perror_and_die
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200141fsck - interactive, longterm
Denys Vlasenko65147852017-08-04 19:16:01 +0200142fsck.minix - needs ^C
Denys Vlasenko9f598492017-08-05 01:29:12 +0200143fsfreeze - noexec. leaks: open+xioctl
144fstrim - noexec. leaks: open+xioctl, find_block_device -> readdir+xstrdup
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200145fsync - NOFORK
146ftpd - daemon
147ftpget - runner
148ftpput - runner
149fuser - complex
Denys Vlasenko83d77852017-08-04 17:59:46 +0200150getopt - noexec. leaks: many allocs
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200151getty - interactive, longterm
152grep - longterm runner ("CMD | grep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200153groups - noexec
154gunzip - runner
155gzip - runner
156halt - rare
Denys Vlasenko39194f02017-08-03 19:00:01 +0200157hd - noexec. runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200158hdparm - hardware
Denys Vlasenko39194f02017-08-03 19:00:01 +0200159head - noexec. runner
160hexdump - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200161hostid - NOFORK
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +0200162hostname - noexec. talks to network (hostname -d may query DNS)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200163httpd - daemon
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200164hush - interactive, longterm
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200165hwclock - hardware (xioctl(RTC_RD_TIME))
166i2cdetect - hardware
167i2cdump - hardware
168i2cget - hardware
169i2cset - hardware
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200170id - noexec
Denys Vlasenkoae844182017-08-07 23:14:49 +0200171ifconfig - hardware? (mem_start NN io_addr NN irq NN), leaks: xsocket+ioctl_or_perror_and_die
172ifenslave - noexec. leaks: xsocket+bb_perror_msg_and_die
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200173ifplugd - daemon
174inetd - daemon
175init - daemon
176inotifyd - daemon
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200177insmod - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200178install - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200179ionice - noexec. spawner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200180iostat - longterm: "iostat 1" runs indefinitely
Denys Vlasenko72d725d2017-08-03 19:30:21 +0200181ip - noexec candidate
182ipaddr - noexec candidate
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +0200183ipcalc - noexec. ipcalc -h talks to network
Denys Vlasenko72d725d2017-08-03 19:30:21 +0200184ipcrm - noexec candidate
185ipcs - noexec candidate
186iplink - noexec candidate
187ipneigh - noexec candidate
188iproute - noexec candidate
189iprule - noexec candidate
190iptunnel - noexec candidate
Denys Vlasenko9a58cc02017-08-06 12:28:00 +0200191kbd_mode - noexec. leaks: xopen_nonblocking+xioctl
Denys Vlasenko39194f02017-08-03 19:00:01 +0200192kill - NOFORK
193killall - NOFORK
194killall5 - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200195klogd - daemon
Denys Vlasenko39194f02017-08-03 19:00:01 +0200196last - runner (I've got 1300 lines of output when tried it)
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200197less - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200198link - NOFORK
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200199linux32 - noexec. spawner
200linux64 - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200201linuxrc - daemon
202ln - noexec
Denys Vlasenko1b280e42017-08-06 19:05:45 +0200203loadfont - noexec. leaks: config_open+bb_error_msg_and_die("map format")
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200204loadkmap - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200205logger - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200206login - suid, interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200207logname - NOFORK
Denys Vlasenkoae844182017-08-07 23:14:49 +0200208losetup - noexec. complex
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200209lpd - daemon
210lpq - runner
211lpr - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200212ls - noexec. runner
Denys Vlasenko99125c02017-08-05 20:38:04 +0200213lsattr - noexec. runner
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200214lsmod - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200215lsof - complex
Denys Vlasenko3239ab82017-08-05 23:28:19 +0200216lspci - noexec. too rare to bother for nofork
217lsscsi - noexec. too rare to bother for nofork
218lsusb - noexec. too rare to bother for nofork
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200219lzcat - runner
220lzma - runner
221lzop - runner
222lzopcat - runner
Denys Vlasenko9536ef72017-08-06 21:47:07 +0200223makedevs - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200224makemime - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200225man - spawner, interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +0200226md5sum - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200227mdev - daemon
Denys Vlasenko65147852017-08-04 19:16:01 +0200228mesg - NOFORK
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200229microcom - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200230mkdir - NOFORK
Denys Vlasenko947b2392017-08-04 18:36:55 +0200231mkdosfs - needs ^C
232mke2fs - needs ^C
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200233mkfifo - noexec
Denys Vlasenko947b2392017-08-04 18:36:55 +0200234mkfs.ext2 - needs ^C
235mkfs.minix - needs ^C
236mkfs.vfat - needs ^C
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200237mknod - noexec
Denys Vlasenkofeb79e82017-08-05 02:08:23 +0200238mkpasswd - noexec. changes state: with --password-fd=N, moves N to stdin
Denys Vlasenko947b2392017-08-04 18:36:55 +0200239mkswap - needs ^C
Denys Vlasenko6bec24c2017-08-04 17:39:05 +0200240mktemp - noexec. leaks: xstrdup+concat_path_file
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200241modinfo - noexec
242modprobe - noexec
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200243more - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200244mount - suid
Denys Vlasenko9f598492017-08-05 01:29:12 +0200245mountpoint - noexec. leaks: option -n "print dev name": find_block_device -> readdir+xstrdup
Denys Vlasenkoa759b222017-08-06 14:15:24 +0200246mpstat - longterm: "mpstat 1" runs indefinitely
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200247mt - hardware
Denys Vlasenko65147852017-08-04 19:16:01 +0200248mv - noexec candidate, runner
Denys Vlasenkoa759b222017-08-06 14:15:24 +0200249nameif - noexec. openlog(), leaks: config_open2+ioctl_or_perror_and_die
Denys Vlasenkobfc66d42017-08-06 21:53:39 +0200250nbd-client - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200251nc - runner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200252netstat - longterm with -c (continuous listing)
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200253nice - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200254nl - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200255nmeter - longterm
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200256nohup - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200257nproc - NOFORK
258ntpd - daemon
259od - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200260openvt - longterm: spawns a child and waits for it
Denys Vlasenko9c49d6e2017-08-05 01:46:39 +0200261partprobe - noexec. leaks: open+ioctl_or_perror_and_die(BLKRRPART)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200262passwd - suid
Denys Vlasenko39194f02017-08-03 19:00:01 +0200263paste - noexec. runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200264patch - needs ^C
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200265pgrep - must fork+exec to get correct /proc/PID/cmdline and comm field
266pidof - must fork+exec to get correct /proc/PID/cmdline and comm field
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200267ping - suid, longterm
268ping6 - suid, longterm
Denys Vlasenko65147852017-08-04 19:16:01 +0200269pipe_progress - longterm
Denys Vlasenkofdb92352017-08-05 01:51:12 +0200270pivot_root - NOFORK
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200271pkill - must fork+exec to get correct /proc/PID/cmdline and comm field
Denys Vlasenko947b2392017-08-04 18:36:55 +0200272pmap - noexec candidate, leaks: open+xstrdup
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200273popmaildir - runner
274poweroff - rare
Denys Vlasenko39194f02017-08-03 19:00:01 +0200275powertop - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200276printenv - NOFORK
277printf - NOFORK
Denys Vlasenko00c18112017-08-05 22:25:00 +0200278ps - looks for AT_CLKTCK elf aux vector, therefore can't be noexec
Denys Vlasenko72d725d2017-08-03 19:30:21 +0200279pscan - longterm
Denys Vlasenko00c18112017-08-05 22:25:00 +0200280pstree - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200281pwd - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200282pwdx - NOFORK
Denys Vlasenkoa894a4b2017-08-06 19:08:46 +0200283raidautorun - noexec. very simple. leaks: open+xioctl
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +0200284rdate - talks to network
285rdev - noexec. leaks: find_block_device -> readdir+xstrdup
Denys Vlasenko39194f02017-08-03 19:00:01 +0200286readlink - NOFORK
Denys Vlasenko9536ef72017-08-06 21:47:07 +0200287readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing?
Denys Vlasenko39194f02017-08-03 19:00:01 +0200288realpath - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200289reboot - rare
290reformime - runner
Denys Vlasenko7b8372b2017-08-07 00:28:15 +0200291remove-shell - noexec. leaks: open+xfunc
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200292renice - noexec. nofork candidate(uses getpwnam, is that ok?)
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200293reset - noexec. spawner (execs "stty")
Denys Vlasenko39194f02017-08-03 19:00:01 +0200294resize - noexec. changes state (signal handlers)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200295rev - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200296rm - noexec. rm -i interactive
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200297rmdir - NOFORK
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200298rmmod - noexec
Denys Vlasenko90ad4ba2017-08-08 00:42:15 +0200299route - talks to network (may query DNS to convert IPs to names)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200300rpm - runner
301rpm2cpio - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200302rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless
Denys Vlasenkoa894a4b2017-08-06 19:08:46 +0200303run-parts - longterm
Denys Vlasenko83d77852017-08-04 17:59:46 +0200304runlevel - noexec. can be nofork if "endutxent()" is called unconditionally, but too rare to bother?
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200305runsv - daemon
306runsvdir - daemon
307rx - runner
Denys Vlasenkodd55d5d2017-08-07 01:53:17 +0200308script - longterm: pumps script output from slave pty
309scriptreplay - longterm: plays back "script" saved output, sleeping as necessary.
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200310sed - runner
311sendmail - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200312seq - noexec. runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200313setarch - noexec. spawner
Denys Vlasenko5cb907f2017-08-06 18:56:25 +0200314setconsole - noexec
Denys Vlasenko1b280e42017-08-06 19:05:45 +0200315setfont - noexec. leaks a lot of stuff
Denys Vlasenkob83db4d2017-08-06 18:29:25 +0200316setkeycodes - noexec
Denys Vlasenko341ce0a2017-08-06 18:17:58 +0200317setlogcons - noexec
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200318setpriv - spawner, changes state, let's play safe and not be noexec
Denys Vlasenko97b738d2017-08-06 18:06:46 +0200319setserial - noexec
Denys Vlasenko22627462017-08-06 17:14:09 +0200320setsid - spawner, uses fork_or_rexec() [not audited to work in noexec], let's play safe and not be noexec
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200321setuidgid - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200322sha1sum - noexec. runner
323sha256sum - noexec. runner
324sha3sum - noexec. runner
325sha512sum - noexec. runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200326showkey - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200327shred - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200328shuf - noexec. runner
Denys Vlasenko22627462017-08-06 17:14:09 +0200329slattach - longterm (may sleep forever), uses bb_common_bufsiz1
Denys Vlasenko947b2392017-08-04 18:36:55 +0200330sleep - runner, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200331smemcap - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200332softlimit - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200333sort - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200334split - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200335ssl_client - longterm
Denys Vlasenko184c7382017-08-06 20:55:56 +0200336start-stop-daemon - not noexec: uses bb_common_bufsiz1
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200337stat - noexec. nofork candidate(needs fewer allocs)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200338strings - runner
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200339stty - noexec. nofork candidate: has no allocs or opens except xmove_fd(xopen("-F DEVICE"),STDIN). tcsetattr(STDIN) is not a problem: it would work the same across processes sharing this fd
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200340su - suid, spawner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200341sulogin - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200342sum - runner
Denys Vlasenkoa453ca52017-08-05 01:42:08 +0200343sv - noexec. needs ^C (uses usleep(420000))
344svc - noexec. needs ^C (uses usleep(420000))
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200345svlogd - daemon
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200346swapoff - longterm: may cause memory pressure, execing is beneficial
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200347swapon - rare
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200348switch_root - spawner, rare, changes state (oh yes), execing may be important to free binary's inode
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200349sync - NOFORK
Denys Vlasenkocaf26b32017-08-05 18:23:10 +0200350sysctl - noexec. leaks: xstrdup+xmalloc_read
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200351syslogd - daemon
Denys Vlasenko39194f02017-08-03 19:00:01 +0200352tac - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200353tail - runner
354tar - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200355taskset - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200356tcpsvd - daemon
357tee - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200358telnet - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200359telnetd - daemon
360test - NOFORK
361tftp - runner
362tftpd - daemon
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200363time - spawner, longterm, changes state (signals)
364timeout - spawner, longterm, changes state (signals)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200365top - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200366touch - NOFORK
367tr - runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200368traceroute - suid, longterm
369traceroute6 - suid, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200370true - NOFORK
371truncate - NOFORK
372tty - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200373ttysize - NOFORK
Denys Vlasenko9a58cc02017-08-06 12:28:00 +0200374tunctl - noexec
Denys Vlasenko99125c02017-08-05 20:38:04 +0200375tune2fs - noexec. leaks: open+xfunc
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200376ubiattach - hardware
377ubidetach - hardware
378ubimkvol - hardware
379ubirename - hardware
380ubirmvol - hardware
381ubirsvol - hardware
382ubiupdatevol - hardware
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200383udhcpc - daemon
384udhcpd - daemon
385udpsvd - daemon
386uevent - daemon
Denys Vlasenko83a6c8d2017-08-05 23:21:02 +0200387umount - noexec. leaks: nested xmalloc
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200388uname - NOFORK
389uncompress - runner
390unexpand - runner
391uniq - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200392unix2dos - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200393unlink - NOFORK
394unlzma - runner
395unlzop - runner
396unxz - runner
397unzip - runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200398uptime - noexec. nofork candidate(is getutxent ok?)
399users - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200400usleep - NOFORK
401uudecode - runner
402uuencode - runner
Denys Vlasenkoa4d4ab02017-08-09 18:52:19 +0200403vconfig - noexec. leaks: xsocket+ioctl_or_perror_and_die
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200404vi - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200405vlock - suid
Denys Vlasenkoae844182017-08-07 23:14:49 +0200406volname - hardware (reads CDROM, this can take long-ish if need to spin up)
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200407w - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200408wall - suid
Denys Vlasenko83d77852017-08-04 17:59:46 +0200409watch - longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200410watchdog - daemon
411wc - runner
Denys Vlasenko83d77852017-08-04 17:59:46 +0200412wget - longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200413which - NOFORK
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200414who - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200415whoami - NOFORK
Denys Vlasenko8858a982017-08-08 01:21:49 +0200416whois - talks to network
Denys Vlasenko39194f02017-08-03 19:00:01 +0200417xargs - noexec. spawner
418xxd - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200419xz - runner
420xzcat - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200421yes - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200422zcat - runner
423zcip - daemon