aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 16:01:39 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 16:01:39 +0200
commit7f9d62d7f5b67b6b1cc7e0b94826ba2a6e193586 (patch)
tree347ff34f9b1d558859d47cd67ef22e73567a9a9e
parentf8cdc7a2bcd0a9d067f5ca7da8ce7bc9c98cf34e (diff)
downloadbusybox-w32-7f9d62d7f5b67b6b1cc7e0b94826ba2a6e193586.tar.gz
busybox-w32-7f9d62d7f5b67b6b1cc7e0b94826ba2a6e193586.tar.bz2
busybox-w32-7f9d62d7f5b67b6b1cc7e0b94826ba2a6e193586.zip
tweak NOFORK_NOEXEC.lst
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst20
1 files changed, 11 insertions, 9 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index 14019bf7d..74922ff52 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -2,26 +2,28 @@ Why an applet can't be NOFORK or NOEXEC?
2 2
3Why can't be NOFORK: 3Why can't be NOFORK:
4interactive: may wait for user input, ^C has to work 4interactive: may wait for user input, ^C has to work
5spawner: "tool PROG ARGS" which changes program's environment - must fork 5spawner: "tool PROG ARGS" which changes program state and execs - must fork
6changes state: e.g. environment, signal handlers 6changes state: e.g. environment, signal handlers
7alloc+xfunc: xmalloc, then xfunc - leaks memory if xfunc dies 7alloc+xfunc: xmalloc, then xfunc - leaks memory if xfunc dies
8open+xfunc: opens fd, then calls xfunc - fd is leaked if xfunc dies 8open+xfunc: opens fd, then calls xfunc - fd is leaked if xfunc dies
9leaks: does not free allocated memory or opened fds
9runner: sometimes may run for long(ish) time, and/or works with network: 10runner: sometimes may run for long(ish) time, and/or works with network:
10 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc) 11 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc)
11 12
12"runners" can become eligible after shell is taught ^C to interrupt NOFORKs! 13"runners" can become eligible after shell is taught ^C to interrupt NOFORKs,
14need to be inspected that they do not fall into alloc+xfunc, open+xfunc
15categories.
13 16
14Why can't be NOEXEC: 17Why can't be NOEXEC:
15suid: runs under different uid - must fork+exec 18suid: runs under different uid - must fork+exec
16 19
17Why shouldn't be NOFORK/NOEXEC: 20Why shouldn't be NOFORK/NOEXEC:
18complex: no immediately obvious reason why NOFORK wouldn't work, 21rare: not started often enough to bother optimizing (example: poweroff)
19 but does some non-obvoius operations (example: fuser, lsof, losetup); 22daemon: runs indefinitely; these are also always fit "rare" category
20 nested xmallocs (typical in complex code) is a problem for NOFORK
21rare: not used often enough to bother optimizing (example: poweroff)
22longterm: often runs for a long time (many seconds), execing would make 23longterm: often runs for a long time (many seconds), execing would make
23 memory footprint smaller 24 memory footprint smaller
24daemon: runs indefinitely 25complex: no immediately obvious reason why NOFORK wouldn't work,
26 but does some non-obvoius operations (example: fuser, lsof, losetup)
25 27
26[ - NOFORK 28[ - NOFORK
27[[ - NOFORK 29[[ - NOFORK
@@ -59,7 +61,7 @@ chpasswd - runner (list of "user:password"s from stdin)
59chpst - spawner 61chpst - spawner
60chroot - spawner 62chroot - spawner
61chrt - spawner 63chrt - spawner
62chvt 64chvt - leaks: get_console_fd_or_die() may open a new fd, or return one of stdio fds. Also, "rare" category. Can be noexec.
63cksum - noexec. runner 65cksum - noexec. runner
64clear - NOFORK 66clear - NOFORK
65cmp - runner 67cmp - runner
@@ -69,7 +71,7 @@ cp - noexec. runner
69cpio - runner 71cpio - runner
70crond - daemon 72crond - daemon
71crontab 73crontab
72cryptpw 74cryptpw - changes state: with --password-fd=N, moves N to stdin. Also, "rare" category. Can be noexec.
73cttyhack - spawner 75cttyhack - spawner
74cut - noexec. runner 76cut - noexec. runner
75date - noexec. nofork candidate(needs to stop messing up env, free xasprintf result, not use xfuncs after xasprintf) 77date - noexec. nofork candidate(needs to stop messing up env, free xasprintf result, not use xfuncs after xasprintf)