Re: top delay value
- From: Mike Meyer <mwm-keyword-freebsdhackers2.e313df@xxxxxxxxx>
- Date: Tue, 30 Jan 2007 10:56:46 -0500
In <20070130140227.26613101832@xxxxxxxxxxxxxxxx>, waldeck@xxxxxx typed:
An unprivileged user could waste all CPU time by setting a low delay value in top (interactive or via -s).
No, they can't. Should they use the interactive facility to set the
delay to 0 (you can't do that via the -s switch), then top will
compete evenly with normal users processes until it accumulates enough
CPU that the scheduler changes it's nice value. It then no longer
competes with normal user processes for CPU. At that point, the CPU
cyles it's "wasting" are mostly cycles that would have been "wasted"
in an idle loop anyway. Generally (but not always), there's no real
reason to care about such.
Is there any possibility to deactivate this functionality without recompilation?
chmod 0 /usr/bin/top
There are other top implementations that use a "secure mode" configuration
which avoids the setting of the delay value for unprivileged users.
There are *lots* of commands on the system that can be coerced into
spinning on the CPU doing nothing, starting with /bin/sh. The correct
place to deal with this issue is in the kernel scheduler, so you can
do it once and for all.
That said, there may be a use case where you want a top display to be
available without the interactive commands being available, ala the
"secure mode" you mention. That can be provided with a little work,
depending on the exact goals.
<mike
--
Mike Meyer <mwm@xxxxxxxxx> http://www.mired.org/consulting.html
Independent Network/Unix/Perforce consultant, email for more information.
_______________________________________________
freebsd-hackers@xxxxxxxxxxx mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@xxxxxxxxxxx"
- References:
- top delay value
- From: waldeck
- top delay value
- Prev by Date: Re: top delay value
- Next by Date: Re: top delay value
- Previous by thread: Re: top delay value
- Index(es):
Relevant Pages
- [PATCH 1/3] Change return value from queue_work
... The new routines call the original ... unsigned long delay) ...
struct work_struct *work) ... We queue the work to the CPU it was submitted, ...
(Linux-Kernel) - Re: PII vs PIII
... Because there is no reason for a 10 second delay. ... having a single CPU
unless the task that was running was improperly ... time-critical, like video capture or
CDRW/DVD burning, don't even come ... The single CPU system ... (comp.os.linux.hardware) - Re: Fixes for nforce2 hard lockup, apic, io-apic, udma133 covered
... >> your existing code path so I think I was being too optimistic in the ...
> Maybe it scales with bus speed, not CPU internal speed? ... after about 6 hrs
on 800ns delay timeout. ... (Linux-Kernel) - Re: 306 Borg Winner
... running the borg at top speed with a "below normal" priority might use ... 100%
CPU but not cripple the UI's responsiveness or make your work not ... delay to the
minimum, then if you have problems increase it. ... inadequate CPU cooling prior to their
acquisition by HP; ... (rec.games.roguelike.angband) - Re: select & gettimeofday
... >> That was true with kernels up to 2.4, ... Certainly attempting to consistently
get any delay approaching ... Twenty years ago, when a 10 ms interval was efficient, a
cpu could ... waiting and yet show a cpu with idle time! ... (comp.os.linux.development.system)