mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Radoslaw Szkodzinski (AstralStorm) <lkml@astralstorm.puszkin.org>
To: Dane Mutters <dmutters@gmail.com>
Cc: Diego Calleja <diegocg@gmail.com>,
	Martin Olsson <mnemo@minimum.se>,
	Peter Zijlstra <peterz@infradead.org>,
	Alan Cox <alan@lxorguk.ukuu.org.uk>,
	linux-kernel@vger.kernel.org
Subject: Re: Is it possible to give the user the option to cancel forkbombs?
Date: Fri, 23 Nov 2007 08:34:47 +0100	[thread overview]
Message-ID: <20071123083447.3a3e4d23@astralstorm.puszkin.org> (raw)
In-Reply-To: <1195322101.15120.3.camel@Orchestrator>

[-- Attachment #1: Type: text/plain, Size: 887 bytes --]

On Sat, 17 Nov 2007 09:55:01 -0800
Dane Mutters <dmutters@gmail.com> wrote:

> I don't know if this is at all feasible, but is it possible to have a
> mechanism that would detect a fork bomb in progress and either stop the
> fork, or allow the user to cancel the operation?  For example, are there
> any legitimate processes (i.e. ones that really need to fork like crazy)
> that would need to generate 200+ processes in less than 1 second?
> 
> (Note: I'm not a programmer; I'm just throwing out the idea.)
> 

If the parent PID of the new task is exported through TASKSTATS, you can
do it already in userspace. If not, that data should be exported.

Then you could write a root daemon using netlink, set it to RT priority
and create an inheritable counter in it to thwart binary forking.
The counter would be cleared every x seconds.
No need to do it in the kernel.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

  reply	other threads:[~2007-11-23  7:35 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-17  5:51 Martin Olsson
2007-11-16 21:31 ` Alan Cox
2007-11-17  7:04   ` Martin Olsson
2007-11-16 23:46     ` Alan Cox
2007-11-17  6:45     ` Dane Mutters
2007-11-17  7:44       ` Peter Zijlstra
2007-11-17 10:39         ` Alan Cox
2007-11-17 13:36           ` Andi Kleen
2007-11-17 15:28             ` Herbert Xu
2007-11-17 17:42         ` Martin Olsson
2007-11-17 10:03           ` Peter Zijlstra
2007-11-17 15:53           ` Diego Calleja
2007-11-17 17:55             ` Dane Mutters
2007-11-23  7:34               ` Radoslaw Szkodzinski [this message]
2007-11-22  0:05     ` (``-_-´´) -- Fernando
2007-11-22 12:03       ` David Newall
2007-11-16 21:38 ` Diego Calleja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20071123083447.3a3e4d23@astralstorm.puszkin.org \
    --to=lkml@astralstorm.puszkin.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=diegocg@gmail.com \
    --cc=dmutters@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mnemo@minimum.se \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®