On Tue, Oct 12, 2010 at 12:41:04AM +0400, Dmitry-T wrote:
> I'm install OpenBSD 4.7 (dmesg attached)
>
> uname -a
> OpenBSD d1.my.domain 4.7 GENERIC#112 amd64
>
> Run as root:
> dd if=/dev/wd0c of=/dev/null bs=1m &
> dd if=/dev/wd0c of=/dev/null bs=1m &
> dd if=/dev/wd0c of=/dev/null bs=1m &
>
> top
>
> load averages: 3.12, 2.50, 1.49 16:54:08
> 37 processes: 36 idle, 1 on processor
> CPU states: 0.1% user, 0.0% nice, 7.3% system, 3.6% interrupt, 89.1% idle
> Memory: Real: 35M/339M act/tot Free: 2393M Swap: 0K/3071M used/tot
>
> PID USERNAME PRI NICE SIZE RES STATE WAIT TIME CPU COMMAND
> 754 root -14 0 2232K 1228K sleep inode 0:24 6.10% dd
> 25914 root -5 0 2216K 1224K sleep getblk 0:24 6.05% dd
> 21919 root -14 0 2204K 1224K sleep inode 2:08 5.96% dd
>
> iostat wd0 1
>
> tty wd0 cpu
> tin tout KB/t t/s MB/s us ni sy in id
> 0 0 2.00 5141 10.04 0 0 23 13 64
> 0 0 2.00 5021 9.81 0 0 16 10 74
> 0 299 2.00 5206 10.17 0 0 21 8 71
> 0 0 2.00 5066 9.90 0 0 15 8 77
>
>
> Run as _normal user_:
> dd if=/dev/urandom of=/dev/null
>
> Try to recover ballance:
> renice 20 -p 30996
> renice -20 -p 21919 25914 754
^^^^^
If you run any cpu bound process with priority -20, you will give all
the cpu to that process, without giving any chance to other processes
to run, so your box will hang until it terminates. This requires root
privileges.
>
> It is not secure. One user script or program may load CPU and
> database or another servers lost speed in disk operations.
> This is hole for DOS attacks in OpenBSD design.
Yeah, this is an attack root can do by renicing a cpu bound process,
but ``rm -rf /'' is much easier, isn't it?
-- Alexandre