diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-08 00:42:15 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2017-08-08 00:42:15 +0200 |
commit | 90ad4ba9db2927d6b616993cc27274bbc17d51a9 (patch) | |
tree | e9f88a91d273344022cb443ec11378b3d18326ac | |
parent | dbbc3f2e644c38e9b4993a674269478792195127 (diff) | |
download | busybox-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.lst | 23 | ||||
-rw-r--r-- | networking/ipcalc.c | 2 | ||||
-rw-r--r-- | util-linux/rdev.c | 2 |
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 | |||
7 | leaks: does not free allocated memory or opened fds | 7 | leaks: 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 |
10 | talks 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 | ||
10 | runner: sometimes may run for long(ish) time, and/or works with network: | 13 | runner: 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 | |||
46 | adjtimex - NOFORK | 49 | adjtimex - NOFORK |
47 | ar - runner | 50 | ar - runner |
48 | arch - NOFORK | 51 | arch - NOFORK |
49 | arp - runner, needs ^C: arp -n talks to DNS servers | 52 | arp - talks to network: arp -n queries DNS |
50 | arping - longterm | 53 | arping - longterm |
51 | ash - interactive, longterm | 54 | ash - interactive, longterm |
52 | awk - noexec. runner | 55 | awk - noexec. runner |
@@ -62,13 +65,13 @@ bunzip2 - runner | |||
62 | bzcat - runner | 65 | bzcat - runner |
63 | bzip2 - runner | 66 | bzip2 - runner |
64 | cal - runner: cal -n9999 | 67 | cal - runner: cal -n9999 |
65 | cat - runner | 68 | cat - runner: cat HUGEFILE |
66 | chat - needs ^C to work | 69 | chat - longterm (when used as intended - talking to modem over stdin/out) |
67 | chattr - noexec. runner | 70 | chattr - noexec. runner |
68 | chgrp - noexec. runner | 71 | chgrp - noexec. runner |
69 | chmod - noexec. runner | 72 | chmod - noexec. runner |
70 | chown - noexec. runner | 73 | chown - noexec. runner |
71 | chpasswd - longterm (list of "user:password"s from stdin) | 74 | chpasswd - longterm? (list of "user:password"s from stdin) |
72 | chpst - noexec. spawner | 75 | chpst - noexec. spawner |
73 | chroot - noexec. spawner | 76 | chroot - noexec. spawner |
74 | chrt - noexec. spawner | 77 | chrt - noexec. spawner |
@@ -99,7 +102,7 @@ diff - runner | |||
99 | dirname - NOFORK | 102 | dirname - NOFORK |
100 | dmesg - runner | 103 | dmesg - runner |
101 | dnsd - daemon | 104 | dnsd - daemon |
102 | dnsdomainname - noexec. needs ^C (may talk to DNS servers, which may be down) | 105 | dnsdomainname - noexec. talks to network (may query DNS) |
103 | dos2unix - noexec. runner | 106 | dos2unix - noexec. runner |
104 | dpkg - runner | 107 | dpkg - runner |
105 | du - runner | 108 | du - runner |
@@ -156,7 +159,7 @@ hdparm - hardware | |||
156 | head - noexec. runner | 159 | head - noexec. runner |
157 | hexdump - noexec. runner | 160 | hexdump - noexec. runner |
158 | hostid - NOFORK | 161 | hostid - NOFORK |
159 | hostname - noexec. needs ^C (may talk to DNS servers, which may be down) | 162 | hostname - noexec. talks to network (hostname -d may query DNS) |
160 | httpd - daemon | 163 | httpd - daemon |
161 | hush - interactive, longterm | 164 | hush - interactive, longterm |
162 | hwclock - hardware (xioctl(RTC_RD_TIME)) | 165 | hwclock - hardware (xioctl(RTC_RD_TIME)) |
@@ -177,7 +180,7 @@ ionice - noexec. spawner | |||
177 | iostat - longterm: "iostat 1" runs indefinitely | 180 | iostat - longterm: "iostat 1" runs indefinitely |
178 | ip - noexec candidate | 181 | ip - noexec candidate |
179 | ipaddr - noexec candidate | 182 | ipaddr - noexec candidate |
180 | ipcalc - noexec candidate | 183 | ipcalc - noexec. ipcalc -h talks to network |
181 | ipcrm - noexec candidate | 184 | ipcrm - noexec candidate |
182 | ipcs - noexec candidate | 185 | ipcs - noexec candidate |
183 | iplink - noexec candidate | 186 | iplink - noexec candidate |
@@ -278,8 +281,8 @@ pstree - noexec | |||
278 | pwd - NOFORK | 281 | pwd - NOFORK |
279 | pwdx - NOFORK | 282 | pwdx - NOFORK |
280 | raidautorun - noexec. very simple. leaks: open+xioctl | 283 | raidautorun - noexec. very simple. leaks: open+xioctl |
281 | rdate - needs ^C (may talk to DNS servers, which may be down) | 284 | rdate - talks to network |
282 | rdev - leaks: find_block_device -> readdir+xstrdup | 285 | rdev - noexec. leaks: find_block_device -> readdir+xstrdup |
283 | readlink - NOFORK | 286 | readlink - NOFORK |
284 | readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing? | 287 | readprofile - reads /boot/System.map and /proc/profile, better to free more memory by execing? |
285 | realpath - NOFORK | 288 | realpath - NOFORK |
@@ -293,7 +296,7 @@ rev - runner | |||
293 | rm - noexec. rm -i interactive | 296 | rm - noexec. rm -i interactive |
294 | rmdir - NOFORK | 297 | rmdir - NOFORK |
295 | rmmod - noexec | 298 | rmmod - noexec |
296 | route - needs ^C (may talk to DNS servers, which may be down) | 299 | route - talks to network (may query DNS to convert IPs to names) |
297 | rpm - runner | 300 | rpm - runner |
298 | rpm2cpio - runner | 301 | rpm2cpio - runner |
299 | rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless | 302 | rtcwake - 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 | ||