mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-23 02:05:57 +01:00
shell fork bomb classic
This commit is contained in:
10
README.adoc
10
README.adoc
@@ -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!
|
||||
|
||||
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 './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
|
||||
|
||||
|
||||
8
rootfs_overlay/lkmc/fork_bomb.sh
Executable file
8
rootfs_overlay/lkmc/fork_bomb.sh
Executable 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
|
||||
Reference in New Issue
Block a user