blob: acbe29e6fbd65a090f1a76d4254edd41a6dfcf49 [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 Vlasenko39194f02017-08-03 19:00:01 +020010runner: sometimes may run for long(ish) time, and/or works with network:
Denys Vlasenko819b47a2017-08-03 03:29:32 +020011 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc)
12
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020013"runners" can become eligible after shell is taught ^C to interrupt NOFORKs,
Denys Vlasenko74c05f52017-08-04 17:36:16 +020014need to be inspected that they do not fall into alloc+xfunc, open+xfunc,
15leak categories.
Denys Vlasenko819b47a2017-08-03 03:29:32 +020016
17Why can't be NOEXEC:
18suid: runs under different uid - must fork+exec
Denys Vlasenko248a67f2017-08-07 18:18:09 +020019if it's important that /proc/PID/cmdline and comm are correct.
20 ("pkill sh" killing itself before it kills real "sh" is no fun)
Denys Vlasenko819b47a2017-08-03 03:29:32 +020021
22Why shouldn't be NOFORK/NOEXEC:
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020023rare: not started often enough to bother optimizing (example: poweroff)
24daemon: runs indefinitely; these are also always fit "rare" category
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020025longterm: often runs for a long time (many seconds), execing makes
Denys Vlasenko39194f02017-08-03 19:00:01 +020026 memory footprint smaller
Denys Vlasenko7f9d62d2017-08-04 16:01:39 +020027complex: no immediately obvious reason why NOFORK wouldn't work,
Denys Vlasenko74c05f52017-08-04 17:36:16 +020028 but does some non-obvoius operations (example: fuser, lsof, losetup);
29 detailed audit often turns out that it's a leaker
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020030hardware: performs unusual hardware ops which may take long,
31 or even hang due to hardware or firmware bugs
Denys Vlasenko74c05f52017-08-04 17:36:16 +020032
33Interesting example of "interactive" applet which is nevertheless can be
34(and is) NOEXEC is "rm". Yes, "rm -i" is interactive - but it's not that typical
35for users to keep it waiting for many minutes, whereas running "rm" in shell
36is very typical, and speeding up this common use via NOEXEC is useful.
37IOW: rm is "interactive", but not "longterm".
38
Denys Vlasenko819b47a2017-08-03 03:29:32 +020039
40[ - NOFORK
41[[ - NOFORK
42acpid - daemon
Denys Vlasenko7b8372b2017-08-07 00:28:15 +020043add-shell - noexec. leaks: open+xfunc
44addgroup - noexec. leaks
45adduser - noexec. leaks
Denys Vlasenkoed7d1182017-08-06 20:00:21 +020046adjtimex - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +020047ar - runner
48arch - NOFORK
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020049arp - runner, needs ^C: arp -n talks to DNS servers
50arping - longterm
Denys Vlasenko74c05f52017-08-04 17:36:16 +020051ash - interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +020052awk - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020053base64 - runner
54basename - NOFORK
Denys Vlasenko035e7152017-08-06 20:39:27 +020055beep - longterm: beep -r 999999999
Denys Vlasenko277081e2017-08-06 20:20:47 +020056blkdiscard - noexec. leaks: open+xioctl
Denys Vlasenkobf182392017-08-06 20:16:28 +020057blkid - noexec
Denys Vlasenko9f598492017-08-05 01:29:12 +020058blockdev - noexec. leaks fd
Denys Vlasenko819b47a2017-08-03 03:29:32 +020059bootchartd - daemon
Denys Vlasenko86e07f62017-08-06 20:14:02 +020060brctl - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +020061bunzip2 - runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020062bzcat - runner
63bzip2 - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +020064cal - runner: cal -n9999
Denys Vlasenko819b47a2017-08-03 03:29:32 +020065cat - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +020066chat - needs ^C to work
Denys Vlasenko99125c02017-08-05 20:38:04 +020067chattr - noexec. runner
Denys Vlasenko39194f02017-08-03 19:00:01 +020068chgrp - noexec. runner
69chmod - noexec. runner
70chown - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020071chpasswd - runner (list of "user:password"s from stdin)
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020072chpst - noexec. spawner
73chroot - noexec. spawner
74chrt - noexec. spawner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +020075chvt - 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 +020076cksum - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020077clear - NOFORK
78cmp - runner
79comm - runner
Denys Vlasenko83d77852017-08-04 17:59:46 +020080conspy - interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +020081cp - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +020082cpio - runner
83crond - daemon
Denys Vlasenko22627462017-08-06 17:14:09 +020084crontab - longterm (runs $EDITOR), leaks: open+xasprintf
Denys Vlasenkofeb79e82017-08-05 02:08:23 +020085cryptpw - noexec. changes state: with --password-fd=N, moves N to stdin
Denys Vlasenko5c527dc2017-08-04 19:55:01 +020086cttyhack - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +020087cut - noexec. runner
88date - noexec. nofork candidate(needs to stop messing up env, free xasprintf result, not use xfuncs after xasprintf)
Denys Vlasenko819b47a2017-08-03 03:29:32 +020089dc - runner (eats stdin if no params)
Denys Vlasenko39194f02017-08-03 19:00:01 +020090dd - noexec. runner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +020091deallocvt - 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 +020092delgroup - noexec. leaks
93deluser - noexec. leaks
Denys Vlasenko1a1203f2017-08-07 16:47:34 +020094depmod - longterm(ish)
Denys Vlasenkofc9efcb2017-08-07 22:19:17 +020095devmem - hardware (access to device memory may hang)
96df - noexec. leaks: nested allocs
Denys Vlasenko819b47a2017-08-03 03:29:32 +020097dhcprelay - daemon
98diff - runner
99dirname - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200100dmesg - runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200101dnsd - daemon
Denys Vlasenkoed4393b2017-08-07 20:34:26 +0200102dnsdomainname - noexec. needs ^C (may talk to DNS servers, which may be down)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200103dos2unix - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200104dpkg - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200105du - runner
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200106dumpkmap - noexec. leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds
Denys Vlasenko65147852017-08-04 19:16:01 +0200107dumpleases - leaks: open+xread
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200108echo - NOFORK
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200109ed - interactive, longterm
110egrep - longterm runner ("CMD | egrep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenkoaf5d0082017-08-07 23:23:18 +0200111eject - hardware, leaks: open+ioctl_or_perror_and_die, changes state (moves fds)
Denys Vlasenko83d77852017-08-04 17:59:46 +0200112env - noexec. spawner, changes state (env)
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200113envdir - noexec. spawner
114envuidgid - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200115expand - runner
Denys Vlasenkoaf5d0082017-08-07 23:23:18 +0200116expr - noexec. leaks: nested allocs
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200117factor - runner (eats stdin if no params)
118fakeidentd - daemon
119false - NOFORK
Denys Vlasenko354b1042017-08-07 22:21:54 +0200120fatattr - noexec. leaks: open+xioctl, complex
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200121fbset - hardware, leaks: open+xfunc
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200122fbsplash - runner, longterm
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200123fdflush - hardware, leaks: open+ioctl_or_perror_and_die
124fdformat - hardware, needs ^C (floppy may be unresponsive), longterm
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200125fdisk - interactive, longterm
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200126fgconsole - 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 +0200127fgrep - longterm runner ("CMD | fgrep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200128find - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200129findfs - suid
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200130flash_eraseall - hardware
131flash_lock - hardware
132flash_unlock - hardware
133flashcp - hardware
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200134flock - spawner, changes state (file locks), let's play safe and not be noexec
Denys Vlasenko39194f02017-08-03 19:00:01 +0200135fold - noexec. runner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200136free - noexec. nofork candidate(struct globals, needs to close /proc/meminfo fd)
Denys Vlasenkoec98e3a2017-08-07 23:17:14 +0200137freeramdisk - noexec. leaks: open+ioctl_or_perror_and_die
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200138fsck - interactive, longterm
Denys Vlasenko65147852017-08-04 19:16:01 +0200139fsck.minix - needs ^C
Denys Vlasenko9f598492017-08-05 01:29:12 +0200140fsfreeze - noexec. leaks: open+xioctl
141fstrim - noexec. leaks: open+xioctl, find_block_device -> readdir+xstrdup
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200142fsync - NOFORK
143ftpd - daemon
144ftpget - runner
145ftpput - runner
146fuser - complex
Denys Vlasenko83d77852017-08-04 17:59:46 +0200147getopt - noexec. leaks: many allocs
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200148getty - interactive, longterm
149grep - longterm runner ("CMD | grep ..." may run indefinitely, better to exec to conserve memory)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200150groups - noexec
151gunzip - runner
152gzip - runner
153halt - rare
Denys Vlasenko39194f02017-08-03 19:00:01 +0200154hd - noexec. runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200155hdparm - hardware
Denys Vlasenko39194f02017-08-03 19:00:01 +0200156head - noexec. runner
157hexdump - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200158hostid - NOFORK
Denys Vlasenkoed4393b2017-08-07 20:34:26 +0200159hostname - noexec. needs ^C (may talk to DNS servers, which may be down)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200160httpd - daemon
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200161hush - interactive, longterm
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200162hwclock - hardware (xioctl(RTC_RD_TIME))
163i2cdetect - hardware
164i2cdump - hardware
165i2cget - hardware
166i2cset - hardware
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200167id - noexec
Denys Vlasenkoae844182017-08-07 23:14:49 +0200168ifconfig - hardware? (mem_start NN io_addr NN irq NN), leaks: xsocket+ioctl_or_perror_and_die
169ifenslave - noexec. leaks: xsocket+bb_perror_msg_and_die
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200170ifplugd - daemon
171inetd - daemon
172init - daemon
173inotifyd - daemon
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200174insmod - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200175install - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200176ionice - noexec. spawner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200177iostat - longterm: "iostat 1" runs indefinitely
Denys Vlasenko72d725d2017-08-03 19:30:21 +0200178ip - noexec candidate
179ipaddr - noexec candidate
180ipcalc - noexec candidate
181ipcrm - noexec candidate
182ipcs - noexec candidate
183iplink - noexec candidate
184ipneigh - noexec candidate
185iproute - noexec candidate
186iprule - noexec candidate
187iptunnel - noexec candidate
Denys Vlasenko9a58cc02017-08-06 12:28:00 +0200188kbd_mode - noexec. leaks: xopen_nonblocking+xioctl
Denys Vlasenko39194f02017-08-03 19:00:01 +0200189kill - NOFORK
190killall - NOFORK
191killall5 - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200192klogd - daemon
Denys Vlasenko39194f02017-08-03 19:00:01 +0200193last - runner (I've got 1300 lines of output when tried it)
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200194less - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200195link - NOFORK
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200196linux32 - noexec. spawner
197linux64 - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200198linuxrc - daemon
199ln - noexec
Denys Vlasenko1b280e42017-08-06 19:05:45 +0200200loadfont - noexec. leaks: config_open+bb_error_msg_and_die("map format")
Denys Vlasenkoff53bee2017-08-05 02:02:31 +0200201loadkmap - 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 +0200202logger - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200203login - suid, interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200204logname - NOFORK
Denys Vlasenkoae844182017-08-07 23:14:49 +0200205losetup - noexec. complex
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200206lpd - daemon
207lpq - runner
208lpr - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200209ls - noexec. runner
Denys Vlasenko99125c02017-08-05 20:38:04 +0200210lsattr - noexec. runner
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200211lsmod - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200212lsof - complex
Denys Vlasenko3239ab82017-08-05 23:28:19 +0200213lspci - noexec. too rare to bother for nofork
214lsscsi - noexec. too rare to bother for nofork
215lsusb - noexec. too rare to bother for nofork
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200216lzcat - runner
217lzma - runner
218lzop - runner
219lzopcat - runner
Denys Vlasenko9536ef72017-08-06 21:47:07 +0200220makedevs - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200221makemime - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200222man - spawner, interactive, longterm
Denys Vlasenko39194f02017-08-03 19:00:01 +0200223md5sum - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200224mdev - daemon
Denys Vlasenko65147852017-08-04 19:16:01 +0200225mesg - NOFORK
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200226microcom - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200227mkdir - NOFORK
Denys Vlasenko947b2392017-08-04 18:36:55 +0200228mkdosfs - needs ^C
229mke2fs - needs ^C
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200230mkfifo - noexec
Denys Vlasenko947b2392017-08-04 18:36:55 +0200231mkfs.ext2 - needs ^C
232mkfs.minix - needs ^C
233mkfs.vfat - needs ^C
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200234mknod - noexec
Denys Vlasenkofeb79e82017-08-05 02:08:23 +0200235mkpasswd - noexec. changes state: with --password-fd=N, moves N to stdin
Denys Vlasenko947b2392017-08-04 18:36:55 +0200236mkswap - needs ^C
Denys Vlasenko6bec24c2017-08-04 17:39:05 +0200237mktemp - noexec. leaks: xstrdup+concat_path_file
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200238modinfo - noexec
239modprobe - noexec
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200240more - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200241mount - suid
Denys Vlasenko9f598492017-08-05 01:29:12 +0200242mountpoint - noexec. leaks: option -n "print dev name": find_block_device -> readdir+xstrdup
Denys Vlasenkoa759b222017-08-06 14:15:24 +0200243mpstat - longterm: "mpstat 1" runs indefinitely
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200244mt - hardware
Denys Vlasenko65147852017-08-04 19:16:01 +0200245mv - noexec candidate, runner
Denys Vlasenkoa759b222017-08-06 14:15:24 +0200246nameif - noexec. openlog(), leaks: config_open2+ioctl_or_perror_and_die
Denys Vlasenkobfc66d42017-08-06 21:53:39 +0200247nbd-client - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200248nc - runner
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200249netstat - longterm with -c (continuous listing)
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200250nice - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200251nl - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200252nmeter - longterm
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200253nohup - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200254nproc - NOFORK
255ntpd - daemon
256od - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200257openvt - longterm: spawns a child and waits for it
Denys Vlasenko9c49d6e2017-08-05 01:46:39 +0200258partprobe - noexec. leaks: open+ioctl_or_perror_and_die(BLKRRPART)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200259passwd - suid
Denys Vlasenko39194f02017-08-03 19:00:01 +0200260paste - noexec. runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200261patch - needs ^C
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200262pgrep - must fork+exec to get correct /proc/PID/cmdline and comm field
263pidof - must fork+exec to get correct /proc/PID/cmdline and comm field
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200264ping - suid, longterm
265ping6 - suid, longterm
Denys Vlasenko65147852017-08-04 19:16:01 +0200266pipe_progress - longterm
Denys Vlasenkofdb92352017-08-05 01:51:12 +0200267pivot_root - NOFORK
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200268pkill - must fork+exec to get correct /proc/PID/cmdline and comm field
Denys Vlasenko947b2392017-08-04 18:36:55 +0200269pmap - noexec candidate, leaks: open+xstrdup
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200270popmaildir - runner
271poweroff - rare
Denys Vlasenko39194f02017-08-03 19:00:01 +0200272powertop - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200273printenv - NOFORK
274printf - NOFORK
Denys Vlasenko00c18112017-08-05 22:25:00 +0200275ps - looks for AT_CLKTCK elf aux vector, therefore can't be noexec
Denys Vlasenko72d725d2017-08-03 19:30:21 +0200276pscan - longterm
Denys Vlasenko00c18112017-08-05 22:25:00 +0200277pstree - noexec
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200278pwd - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200279pwdx - NOFORK
Denys Vlasenkoa894a4b2017-08-06 19:08:46 +0200280raidautorun - noexec. very simple. leaks: open+xioctl
Denys Vlasenko947b2392017-08-04 18:36:55 +0200281rdate - needs ^C (may talk to DNS servers, which may be down)
282rdev - leaks: find_block_device -> readdir+xstrdup
Denys Vlasenko39194f02017-08-03 19:00:01 +0200283readlink - NOFORK
Denys Vlasenko9536ef72017-08-06 21:47:07 +0200284readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing?
Denys Vlasenko39194f02017-08-03 19:00:01 +0200285realpath - NOFORK
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200286reboot - rare
287reformime - runner
Denys Vlasenko7b8372b2017-08-07 00:28:15 +0200288remove-shell - noexec. leaks: open+xfunc
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200289renice - noexec. nofork candidate(uses getpwnam, is that ok?)
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200290reset - noexec. spawner (execs "stty")
Denys Vlasenko39194f02017-08-03 19:00:01 +0200291resize - noexec. changes state (signal handlers)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200292rev - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200293rm - noexec. rm -i interactive
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200294rmdir - NOFORK
Denys Vlasenko3346b4a2017-08-04 02:56:39 +0200295rmmod - noexec
Denys Vlasenko947b2392017-08-04 18:36:55 +0200296route - needs ^C (may talk to DNS servers, which may be down)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200297rpm - runner
298rpm2cpio - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200299rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless
Denys Vlasenkoa894a4b2017-08-06 19:08:46 +0200300run-parts - longterm
Denys Vlasenko83d77852017-08-04 17:59:46 +0200301runlevel - noexec. can be nofork if "endutxent()" is called unconditionally, but too rare to bother?
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200302runsv - daemon
303runsvdir - daemon
304rx - runner
Denys Vlasenkodd55d5d2017-08-07 01:53:17 +0200305script - longterm: pumps script output from slave pty
306scriptreplay - longterm: plays back "script" saved output, sleeping as necessary.
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200307sed - runner
308sendmail - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200309seq - noexec. runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200310setarch - noexec. spawner
Denys Vlasenko5cb907f2017-08-06 18:56:25 +0200311setconsole - noexec
Denys Vlasenko1b280e42017-08-06 19:05:45 +0200312setfont - noexec. leaks a lot of stuff
Denys Vlasenkob83db4d2017-08-06 18:29:25 +0200313setkeycodes - noexec
Denys Vlasenko341ce0a2017-08-06 18:17:58 +0200314setlogcons - noexec
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200315setpriv - spawner, changes state, let's play safe and not be noexec
Denys Vlasenko97b738d2017-08-06 18:06:46 +0200316setserial - noexec
Denys Vlasenko22627462017-08-06 17:14:09 +0200317setsid - 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 +0200318setuidgid - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200319sha1sum - noexec. runner
320sha256sum - noexec. runner
321sha3sum - noexec. runner
322sha512sum - noexec. runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200323showkey - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200324shred - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200325shuf - noexec. runner
Denys Vlasenko22627462017-08-06 17:14:09 +0200326slattach - longterm (may sleep forever), uses bb_common_bufsiz1
Denys Vlasenko947b2392017-08-04 18:36:55 +0200327sleep - runner, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200328smemcap - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200329softlimit - noexec. spawner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200330sort - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200331split - runner
Denys Vlasenko947b2392017-08-04 18:36:55 +0200332ssl_client - longterm
Denys Vlasenko184c7382017-08-06 20:55:56 +0200333start-stop-daemon - not noexec: uses bb_common_bufsiz1
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200334stat - noexec. nofork candidate(needs fewer allocs)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200335strings - runner
Denys Vlasenko692eeb82017-08-04 20:07:19 +0200336stty - 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 +0200337su - suid, spawner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200338sulogin - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200339sum - runner
Denys Vlasenkoa453ca52017-08-05 01:42:08 +0200340sv - noexec. needs ^C (uses usleep(420000))
341svc - noexec. needs ^C (uses usleep(420000))
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200342svlogd - daemon
Denys Vlasenko248a67f2017-08-07 18:18:09 +0200343swapoff - longterm: may cause memory pressure, execing is beneficial
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200344swapon - rare
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200345switch_root - spawner, rare, changes state (oh yes), execing may be important to free binary's inode
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200346sync - NOFORK
Denys Vlasenkocaf26b32017-08-05 18:23:10 +0200347sysctl - noexec. leaks: xstrdup+xmalloc_read
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200348syslogd - daemon
Denys Vlasenko39194f02017-08-03 19:00:01 +0200349tac - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200350tail - runner
351tar - runner
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200352taskset - noexec. spawner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200353tcpsvd - daemon
354tee - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200355telnet - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200356telnetd - daemon
357test - NOFORK
358tftp - runner
359tftpd - daemon
Denys Vlasenko5c527dc2017-08-04 19:55:01 +0200360time - spawner, longterm, changes state (signals)
361timeout - spawner, longterm, changes state (signals)
Denys Vlasenko39194f02017-08-03 19:00:01 +0200362top - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200363touch - NOFORK
364tr - runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200365traceroute - suid, longterm
366traceroute6 - suid, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200367true - NOFORK
368truncate - NOFORK
369tty - NOFORK
Denys Vlasenko39194f02017-08-03 19:00:01 +0200370ttysize - NOFORK
Denys Vlasenko9a58cc02017-08-06 12:28:00 +0200371tunctl - noexec
Denys Vlasenko99125c02017-08-05 20:38:04 +0200372tune2fs - noexec. leaks: open+xfunc
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200373ubiattach - hardware
374ubidetach - hardware
375ubimkvol - hardware
376ubirename - hardware
377ubirmvol - hardware
378ubirsvol - hardware
379ubiupdatevol - hardware
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200380udhcpc - daemon
381udhcpd - daemon
382udpsvd - daemon
383uevent - daemon
Denys Vlasenko83a6c8d2017-08-05 23:21:02 +0200384umount - noexec. leaks: nested xmalloc
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200385uname - NOFORK
386uncompress - runner
387unexpand - runner
388uniq - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200389unix2dos - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200390unlink - NOFORK
391unlzma - runner
392unlzop - runner
393unxz - runner
394unzip - runner
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200395uptime - noexec. nofork candidate(is getutxent ok?)
396users - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200397usleep - NOFORK
398uudecode - runner
399uuencode - runner
Denys Vlasenko74c05f52017-08-04 17:36:16 +0200400vconfig - leaks: xsocket+ioctl_or_perror_and_die
401vi - interactive, longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200402vlock - suid
Denys Vlasenkoae844182017-08-07 23:14:49 +0200403volname - hardware (reads CDROM, this can take long-ish if need to spin up)
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200404w - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200405wall - suid
Denys Vlasenko83d77852017-08-04 17:59:46 +0200406watch - longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200407watchdog - daemon
408wc - runner
Denys Vlasenko83d77852017-08-04 17:59:46 +0200409wget - longterm
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200410which - NOFORK
Denys Vlasenko1a1203f2017-08-07 16:47:34 +0200411who - noexec. nofork candidate(is getutxent ok?)
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200412whoami - NOFORK
Denys Vlasenko65147852017-08-04 19:16:01 +0200413whois - needs ^C
Denys Vlasenko39194f02017-08-03 19:00:01 +0200414xargs - noexec. spawner
415xxd - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200416xz - runner
417xzcat - runner
Denys Vlasenko39194f02017-08-03 19:00:01 +0200418yes - noexec. runner
Denys Vlasenko819b47a2017-08-03 03:29:32 +0200419zcat - runner
420zcip - daemon