shell fork bomb classic

This commit is contained in:
Ciro Santilli 六四事件 法轮功
2019-11-12 23:00:01 +00:00
parent ca47a77676
commit ff4aaec5bc
2 changed files with 15 additions and 3 deletions

View File

@@ -13903,15 +13903,19 @@ https://en.wikipedia.org/wiki/Fork_bomb
DANGER! Only run this on your host if you have saved all data you care about! Better run it inside an emulator! QEMU v4.0.0 <<user-mode-simulation,user mode>> is not safe enough either because it is very native does not limit guest memory, so it will still blow up the host! DANGER! Only run this on your host if you have saved all data you care about! Better run it inside an emulator! QEMU v4.0.0 <<user-mode-simulation,user mode>> is not safe enough either because it is very native does not limit guest memory, so it will still blow up the host!
So without further ado, let's rock: So without further ado, let's rock with either:
.... ....
./run --eval-after './posix/fork_bomb.out danger' ./run --eval-after './posix/fork_bomb.out danger'
./run --eval-after './fork_bomb.sh danger'
.... ....
Source: link:userland/posix/fork_bomb.c[] Sources:
Outcome on LKMC 762cd8d601b7db06aa289c0fca7b40696299a868 + 1: after a few seconds of an unresponsive shell, we get a visit form the <<linux-out-of-memory-killer>>, and the system is restored! * link:userland/posix/fork_bomb.c[]
* link:rootfs_overlay/lkmc/fork_bomb.sh[]
Outcome for the C version on LKMC 762cd8d601b7db06aa289c0fca7b40696299a868 + 1: after a few seconds of an unresponsive shell, we get a visit form the <<linux-out-of-memory-killer>>, and the system is restored!
==== pthreads ==== pthreads

View File

@@ -0,0 +1,8 @@
#!/bin/sh
# https://cirosantilli.com/linux-kernel-module-cheat#fork-bomb
if [ "$1" = danger ]; then
bomb() {
bomb | bomb &
}
bomb
fi