aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 18:36:55 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2017-08-04 18:37:34 +0200
commit947b2391c07f8a11f7bd4658f77cd03172fc221a (patch)
treec1cdedad593852a481778ffb41e30d42f03a4767
parent83d7785e413bbfc4c639c855a6e47f64bdc5da9a (diff)
downloadbusybox-w32-947b2391c07f8a11f7bd4658f77cd03172fc221a.tar.gz
busybox-w32-947b2391c07f8a11f7bd4658f77cd03172fc221a.tar.bz2
busybox-w32-947b2391c07f8a11f7bd4658f77cd03172fc221a.zip
pmap: tweak help text, show usage if no params are given
Noticed while auditing nofork/noexec status function old new delta pmap_main 70 80 +10 packed_usage 31747 31744 -3 Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r--NOFORK_NOEXEC.lst60
-rw-r--r--procps/pmap.c3
2 files changed, 32 insertions, 31 deletions
diff --git a/NOFORK_NOEXEC.lst b/NOFORK_NOEXEC.lst
index d6959e363..730f2cc3c 100644
--- a/NOFORK_NOEXEC.lst
+++ b/NOFORK_NOEXEC.lst
@@ -135,7 +135,7 @@ freeramdisk - leaks: open+ioctl_or_perror_and_die
135fsck - interactive, longterm 135fsck - interactive, longterm
136fsck.minix 136fsck.minix
137fsfreeze - noexec candidate (it's very simple), leaks: open+xioctl 137fsfreeze - noexec candidate (it's very simple), leaks: open+xioctl
138fstrim - noexec candidate (it's very simple), leaks: open+xioctl 138fstrim - noexec candidate (it's very simple), leaks: open+xioctl, find_block_device -> readdir+xstrdup
139fsync - NOFORK 139fsync - NOFORK
140ftpd - daemon 140ftpd - daemon
141ftpget - runner 141ftpget - runner
@@ -153,7 +153,7 @@ hdparm - complex, rare
153head - noexec. runner 153head - noexec. runner
154hexdump - noexec. runner 154hexdump - noexec. runner
155hostid - NOFORK 155hostid - NOFORK
156hostname - DNS resolution may trigger, need ^C 156hostname - needs ^C (may talk to DNS servers, which may be down)
157httpd - daemon 157httpd - daemon
158hush - interactive, longterm 158hush - interactive, longterm
159hwclock - talks to hardware (xioctl(RTC_RD_TIME)) - needs ^C 159hwclock - talks to hardware (xioctl(RTC_RD_TIME)) - needs ^C
@@ -222,40 +222,40 @@ mdev - daemon
222mesg 222mesg
223microcom - interactive, longterm 223microcom - interactive, longterm
224mkdir - NOFORK 224mkdir - NOFORK
225mkdosfs 225mkdosfs - needs ^C
226mke2fs 226mke2fs - needs ^C
227mkfifo - noexec 227mkfifo - noexec
228mkfs.ext2 228mkfs.ext2 - needs ^C
229mkfs.minix 229mkfs.minix - needs ^C
230mkfs.vfat 230mkfs.vfat - needs ^C
231mknod - noexec 231mknod - noexec
232mkpasswd 232mkpasswd - changes state: with --password-fd=N, moves N to stdin. Also, "rare" category. Can be noexec.
233mkswap 233mkswap - needs ^C
234mktemp - noexec. leaks: xstrdup+concat_path_file 234mktemp - noexec. leaks: xstrdup+concat_path_file
235modinfo - noexec 235modinfo - noexec
236modprobe - noexec 236modprobe - noexec
237more - interactive, longterm 237more - interactive, longterm
238mount - suid 238mount - suid
239mountpoint 239mountpoint - noexec candidate, leaks: option -n "print dev name": find_block_device -> readdir+xstrdup
240mpstat 240mpstat - noexec candidate (it's a measuring tool, putting less load by itself is good), complex
241mt 241mt - rare
242mv - runner (can be noexec?) 242mv - runner (can be noexec?)
243nameif 243nameif
244nbd-client 244nbd-client
245nc - runner 245nc - runner
246netstat - runner with -c 246netstat - runner with -c
247nice - spawner 247nice - noexec candidate, spawner
248nl - runner 248nl - runner
249nmeter - runner 249nmeter - longterm
250nohup - spawner 250nohup - noexec candidate (maybe free concat_path_file result?), spawner
251nproc - NOFORK 251nproc - NOFORK
252ntpd - daemon 252ntpd - daemon
253od - runner 253od - runner
254openvt - spawner 254openvt - spawner
255partprobe 255partprobe - noexec candidate (simple), leaks: open+ioctl_or_perror_and_die(BLKRRPART)
256passwd - suid 256passwd - suid
257paste - noexec. runner 257paste - noexec. runner
258patch 258patch - needs ^C
259pgrep - nofork candidate(xregcomp, procps_scan - are they ok?) 259pgrep - nofork candidate(xregcomp, procps_scan - are they ok?)
260pidof - nofork candidate(uses find_pid_by_name, is that ok?) 260pidof - nofork candidate(uses find_pid_by_name, is that ok?)
261ping - suid, runner 261ping - suid, runner
@@ -263,7 +263,7 @@ ping6 - suid, runner
263pipe_progress 263pipe_progress
264pivot_root 264pivot_root
265pkill - nofork candidate(xregcomp, procps_scan - are they ok?) 265pkill - nofork candidate(xregcomp, procps_scan - are they ok?)
266pmap 266pmap - noexec candidate, leaks: open+xstrdup
267popmaildir - runner 267popmaildir - runner
268poweroff - rare 268poweroff - rare
269powertop - interactive, longterm 269powertop - interactive, longterm
@@ -275,8 +275,8 @@ pstree
275pwd - NOFORK 275pwd - NOFORK
276pwdx - NOFORK 276pwdx - NOFORK
277raidautorun 277raidautorun
278rdate 278rdate - needs ^C (may talk to DNS servers, which may be down)
279rdev 279rdev - leaks: find_block_device -> readdir+xstrdup
280readlink - NOFORK 280readlink - NOFORK
281readprofile 281readprofile
282realpath - NOFORK 282realpath - NOFORK
@@ -284,16 +284,16 @@ reboot - rare
284reformime - runner 284reformime - runner
285remove-shell 285remove-shell
286renice - nofork candidate(uses getpwnam, is that ok?) 286renice - nofork candidate(uses getpwnam, is that ok?)
287reset - spawner (execs "stty") 287reset - noexec candidate, spawner (execs "stty")
288resize - noexec. changes state (signal handlers) 288resize - noexec. changes state (signal handlers)
289rev - runner 289rev - runner
290rm - noexec. rm -i interactive 290rm - noexec. rm -i interactive
291rmdir - NOFORK 291rmdir - NOFORK
292rmmod - noexec 292rmmod - noexec
293route 293route - needs ^C (may talk to DNS servers, which may be down)
294rpm - runner 294rpm - runner
295rpm2cpio - runner 295rpm2cpio - runner
296rtcwake - puts system to sleep, optimizing this for speed is pointless 296rtcwake - longterm: puts system to sleep, optimizing this for speed is pointless
297run-parts 297run-parts
298runlevel - noexec. can be nofork if "endutxent()" is called unconditionally, but too rare to bother? 298runlevel - noexec. can be nofork if "endutxent()" is called unconditionally, but too rare to bother?
299runsv - daemon 299runsv - daemon
@@ -321,27 +321,27 @@ showkey - interactive, longterm
321shred - runner 321shred - runner
322shuf - noexec. runner 322shuf - noexec. runner
323slattach 323slattach
324sleep - runner 324sleep - runner, longterm
325smemcap - runner 325smemcap - runner
326softlimit - spawner 326softlimit - noexec candidate, spawner
327sort - noexec. runner 327sort - noexec. runner
328split - runner 328split - runner
329ssl_client - network 329ssl_client - longterm
330start-stop-daemon 330start-stop-daemon
331stat - nofork candidate(needs fewer allocs) 331stat - nofork candidate(needs fewer allocs)
332strings - runner 332strings - runner
333stty 333stty - 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
334su - suid, spawner 334su - suid, spawner
335sulogin - spawner 335sulogin - spawner
336sum - runner 336sum - runner
337sv 337sv - noexec candidate, needs ^C (uses usleep(420000))
338svc 338svc - noexec candidate, needs ^C (uses usleep(420000))
339svlogd - daemon 339svlogd - daemon
340swapoff - rare 340swapoff - rare
341swapon - rare 341swapon - rare
342switch_root - spawner, rare, changes state 342switch_root - spawner, rare, changes state
343sync - NOFORK 343sync - NOFORK
344sysctl 344sysctl - noexec candidate, leaks: xstrdup+xmalloc_read
345syslogd - daemon 345syslogd - daemon
346tac - noexec. runner 346tac - noexec. runner
347tail - runner 347tail - runner
diff --git a/procps/pmap.c b/procps/pmap.c
index c8f728897..3dc733974 100644
--- a/procps/pmap.c
+++ b/procps/pmap.c
@@ -18,7 +18,7 @@
18//kbuild:lib-$(CONFIG_PMAP) += pmap.o 18//kbuild:lib-$(CONFIG_PMAP) += pmap.o
19 19
20//usage:#define pmap_trivial_usage 20//usage:#define pmap_trivial_usage
21//usage: "[-xq] PID" 21//usage: "[-xq] PID..."
22//usage:#define pmap_full_usage "\n\n" 22//usage:#define pmap_full_usage "\n\n"
23//usage: "Display process memory usage" 23//usage: "Display process memory usage"
24//usage: "\n" 24//usage: "\n"
@@ -96,6 +96,7 @@ int pmap_main(int argc UNUSED_PARAM, char **argv)
96 unsigned opts; 96 unsigned opts;
97 int ret; 97 int ret;
98 98
99 opt_complementary = "-1"; /* min one arg */
99 opts = getopt32(argv, "xq"); 100 opts = getopt32(argv, "xq");
100 argv += optind; 101 argv += optind;
101 102