aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-08 00:42:15 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-08 00:42:15 +0200
commit90ad4ba9db2927d6b616993cc27274bbc17d51a9 (patch)
treee9f88a91d273344022cb443ec11378b3d18326ac
parentdbbc3f2e644c38e9b4993a674269478792195127 (diff)
downloadbusybox-w32-90ad4ba9db2927d6b616993cc27274bbc17d51a9.tar.gz
busybox-w32-90ad4ba9db2927d6b616993cc27274bbc17d51a9.tar.bz2
busybox-w32-90ad4ba9db2927d6b616993cc27274bbc17d51a9.zip
ipcalc,rdev: make NOEXEC
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst23
-rw-r--r--networking/ipcalc.c2
-rw-r--r--util-linux/rdev.c2
3 files changed, 15 insertions, 12 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index cd83ff1d6..98e1bffdf 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -7,6 +7,9 @@ changes state: e.g. environment, signal handlers
7leaks: does not free allocated memory or opened fds 7leaks: does not free allocated memory or opened fds
8 alloc+xfunc: xmalloc, then xfunc - leaks memory if xfunc dies 8 alloc+xfunc: xmalloc, then xfunc - leaks memory if xfunc dies
9 open+xfunc: opens fd, then calls xfunc - fd is leaked if xfunc dies 9 open+xfunc: opens fd, then calls xfunc - fd is leaked if xfunc dies
10talks 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
10runner: sometimes may run for long(ish) time, and/or works with network: 13runner: sometimes may run for long(ish) time, and/or works with network:
11 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc) 14 ^C has to work (cat BIGFILE, chmod -R, ftpget, nc)
12 15
@@ -46,7 +49,7 @@ adduser - noexec. leaks
46adjtimex - NOFORK 49adjtimex - NOFORK
47ar - runner 50ar - runner
48arch - NOFORK 51arch - NOFORK
49arp - runner, needs ^C: arp -n talks to DNS servers 52arp - talks to network: arp -n queries DNS
50arping - longterm 53arping - longterm
51ash - interactive, longterm 54ash - interactive, longterm
52awk - noexec. runner 55awk - noexec. runner
@@ -62,13 +65,13 @@ bunzip2 - runner
62bzcat - runner 65bzcat - runner
63bzip2 - runner 66bzip2 - runner
64cal - runner: cal -n9999 67cal - runner: cal -n9999
65cat - runner 68cat - runner: cat HUGEFILE
66chat - needs ^C to work 69chat - longterm (when used as intended - talking to modem over stdin/out)
67chattr - noexec. runner 70chattr - noexec. runner
68chgrp - noexec. runner 71chgrp - noexec. runner
69chmod - noexec. runner 72chmod - noexec. runner
70chown - noexec. runner 73chown - noexec. runner
71chpasswd - longterm (list of "user:password"s from stdin) 74chpasswd - longterm? (list of "user:password"s from stdin)
72chpst - noexec. spawner 75chpst - noexec. spawner
73chroot - noexec. spawner 76chroot - noexec. spawner
74chrt - noexec. spawner 77chrt - noexec. spawner
@@ -99,7 +102,7 @@ diff - runner
99dirname - NOFORK 102dirname - NOFORK
100dmesg - runner 103dmesg - runner
101dnsd - daemon 104dnsd - daemon
102dnsdomainname - noexec. needs ^C (may talk to DNS servers, which may be down) 105dnsdomainname - noexec. talks to network (may query DNS)
103dos2unix - noexec. runner 106dos2unix - noexec. runner
104dpkg - runner 107dpkg - runner
105du - runner 108du - runner
@@ -156,7 +159,7 @@ hdparm - hardware
156head - noexec. runner 159head - noexec. runner
157hexdump - noexec. runner 160hexdump - noexec. runner
158hostid - NOFORK 161hostid - NOFORK
159hostname - noexec. needs ^C (may talk to DNS servers, which may be down) 162hostname - noexec. talks to network (hostname -d may query DNS)
160httpd - daemon 163httpd - daemon
161hush - interactive, longterm 164hush - interactive, longterm
162hwclock - hardware (xioctl(RTC_RD_TIME)) 165hwclock - hardware (xioctl(RTC_RD_TIME))
@@ -177,7 +180,7 @@ ionice - noexec. spawner
177iostat - longterm: "iostat 1" runs indefinitely 180iostat - longterm: "iostat 1" runs indefinitely
178ip - noexec candidate 181ip - noexec candidate
179ipaddr - noexec candidate 182ipaddr - noexec candidate
180ipcalc - noexec candidate 183ipcalc - noexec. ipcalc -h talks to network
181ipcrm - noexec candidate 184ipcrm - noexec candidate
182ipcs - noexec candidate 185ipcs - noexec candidate
183iplink - noexec candidate 186iplink - noexec candidate
@@ -278,8 +281,8 @@ pstree - noexec
278pwd - NOFORK 281pwd - NOFORK
279pwdx - NOFORK 282pwdx - NOFORK
280raidautorun - noexec. very simple. leaks: open+xioctl 283raidautorun - noexec. very simple. leaks: open+xioctl
281rdate - needs ^C (may talk to DNS servers, which may be down) 284rdate - talks to network
282rdev - leaks: find_block_device -> readdir+xstrdup 285rdev - noexec. leaks: find_block_device -> readdir+xstrdup
283readlink - NOFORK 286readlink - NOFORK
284readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing? 287readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing?
285realpath - NOFORK 288realpath - NOFORK
@@ -293,7 +296,7 @@ rev - runner
293rm - noexec. rm -i interactive 296rm - noexec. rm -i interactive
294rmdir - NOFORK 297rmdir - NOFORK
295rmmod - noexec 298rmmod - noexec
296route - needs ^C (may talk to DNS servers, which may be down) 299route - talks to network (may query DNS to convert IPs to names)
297rpm - runner 300rpm - runner
298rpm2cpio - runner 301rpm2cpio - runner
299rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless 302rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless
diff --git a/networking/ipcalc.c b/networking/ipcalc.c
index 9888a6ff2..4f192e0a5 100644
--- a/networking/ipcalc.c
+++ b/networking/ipcalc.c
@@ -31,7 +31,7 @@
31//config: Adds the options hostname, prefix and silent to the output of 31//config: Adds the options hostname, prefix and silent to the output of
32//config: "ipcalc". 32//config: "ipcalc".
33 33
34//applet:IF_IPCALC(APPLET(ipcalc, BB_DIR_BIN, BB_SUID_DROP)) 34//applet:IF_IPCALC(APPLET_NOEXEC(ipcalc, ipcalc, BB_DIR_BIN, BB_SUID_DROP, ipcalc))
35 35
36//kbuild:lib-$(CONFIG_IPCALC) += ipcalc.o 36//kbuild:lib-$(CONFIG_IPCALC) += ipcalc.o
37 37
diff --git a/util-linux/rdev.c b/util-linux/rdev.c
index 2ffe07688..7eb7413a8 100644
--- a/util-linux/rdev.c
+++ b/util-linux/rdev.c
@@ -14,7 +14,7 @@
14//config: help 14//config: help
15//config: Print the device node associated with the filesystem mounted at '/'. 15//config: Print the device node associated with the filesystem mounted at '/'.
16 16
17//applet:IF_RDEV(APPLET(rdev, BB_DIR_USR_SBIN, BB_SUID_DROP)) 17//applet:IF_RDEV(APPLET_NOEXEC(rdev, rdev, BB_DIR_USR_SBIN, BB_SUID_DROP, rdev))
18 18
19//kbuild:lib-$(CONFIG_RDEV) += rdev.o 19//kbuild:lib-$(CONFIG_RDEV) += rdev.o
20 20