From: Valdis.Kletnieks@vt.edu
To: linux-kernel@vger.kernel.org, lkml@osndok.com
Subject: Re: A long overdue fork-bomb defense ?
Date: Sat, 09 Apr 2011 16:12:08 -0400 [thread overview]
Message-ID: <106827.1302379928@localhost> (raw)
In-Reply-To: Your message of "Fri, 08 Apr 2011 15:47:13 CDT." <E6EFCBFA-65D9-49D4-B042-EA6773F4D209@osndok.com>
[-- Attachment #1: Type: text/plain, Size: 1227 bytes --]
On Fri, 08 Apr 2011 15:47:13 CDT, Robert Hailey said:
> log("fork_count generation");
> divide_all_process_fork_counts_by_two();
This will involve painful locking on large systems with lots of procs running.
> for ( p : process_table) {
Ditto.
> if (fork_alert_level) {
> if (fork_count >= fork_alert_level) {
> signal(KILL, proc) && log('killed ...');
> //don't: fork_alert_time=now();
> return/dispatch?;
> }
> if (now()-fork_alert_time>10 seconds?) {
> fork_alert_level=0; //Relax
> }
> }
A smart attacker can probably use this to game the fork rate to fly just under
the wire, while still piling up lots of processes, *and* adding extra overhead
as it goes. If the rate limit is 5000 forks every 10 seconds, it can do 4500
every 10 seconds, and in a few minutes the poor scaling sections will eat your
system alive.
(And don't say "but it can be detected and stopped in those few minutes" -
because the *reality* in the security world is that people will say "We have
this great anti-forkbomb patch in the kernel, and don't need to check anymore".
Yes, they *will* do that. Users that will blindly click on stuff because their AV
will stop anything bad are one of the banes of my existence. ;)
[-- Attachment #2: Type: application/pgp-signature, Size: 227 bytes --]
next prev parent reply other threads:[~2011-04-09 20:12 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <67B98EE7-9CD6-44E9-9B6E-C1CDF3115737@osndok.com>
2011-04-08 20:47 ` A long overdue fork-bomb defense ? Robert Hailey
2011-04-09 20:12 ` Valdis.Kletnieks [this message]
2011-04-09 22:25 ` Robert Hailey
2011-04-09 22:44 ` Valdis.Kletnieks
2011-04-09 23:20 ` Robert Hailey
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=106827.1302379928@localhost \
--to=valdis.kletnieks@vt.edu \
--cc=linux-kernel@vger.kernel.org \
--cc=lkml@osndok.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.