From ff4aaec5bc722d71502978de822d947f93a3d8d1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ciro=20Santilli=20=E5=85=AD=E5=9B=9B=E4=BA=8B=E4=BB=B6=20?= =?UTF-8?q?=E6=B3=95=E8=BD=AE=E5=8A=9F?= Date: Tue, 12 Nov 2019 23:00:01 +0000 Subject: [PATCH] shell fork bomb classic --- README.adoc | 10 +++++++--- rootfs_overlay/lkmc/fork_bomb.sh | 8 ++++++++ 2 files changed, 15 insertions(+), 3 deletions(-) create mode 100755 rootfs_overlay/lkmc/fork_bomb.sh diff --git a/README.adoc b/README.adoc index 2973365..410cf41 100644 --- a/README.adoc +++ b/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 <> 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 <>, 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 <>, and the system is restored! ==== pthreads diff --git a/rootfs_overlay/lkmc/fork_bomb.sh b/rootfs_overlay/lkmc/fork_bomb.sh new file mode 100755 index 0000000..fba6c80 --- /dev/null +++ b/rootfs_overlay/lkmc/fork_bomb.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# https://cirosantilli.com/linux-kernel-module-cheat#fork-bomb +if [ "$1" = danger ]; then + bomb() { + bomb | bomb & + } + bomb +fi