From: "Anand Jahagirdar" <anandjigar@gmail.com>
To: security@kernel.org
Cc: linux-kernel@vger.kernel.org
Subject: Patch related with Fork Bombing Atack
Date: Thu, 31 May 2007 06:45:15 -0700 [thread overview]
Message-ID: <25ae38200705310645n5e913a91weaa14521908f7989@mail.gmail.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
Dear Sir
I am forwarding one patch related with fork bombing attack.
actually ulimit helps to prevent fork bombing attack.
1) when i searched for the code which actually prevents
fork bombing attack in kernel/fork.c file, it took lot of time to
search for the code.
2) when we set the ulimit in /etc/security/limits.conf file
for guest account and then try fork bombing attack using guest
account. ulimit prevents fork bombing attack but administrator/root
user wont come to know that somebody is trying fork bombing attack on
his machine.
Due to this two reasons i tried to create a patch which will solve
above mentioned problems.
1) Commented Code in my patch will Definitely Help Developer to get
the prevention code for Fork bombing Attack very easily.
2) Printk message in my patch will definitely help Administrator/Root
User to detect which particular user is trying fork bombing attack on
his machine by looking at /var/log/messages or dmesg . he can take
action against that particular user and kill his processes.
Regards,
Anand
[-- Attachment #2: fork.patch~ --]
[-- Type: application/octet-stream, Size: 937 bytes --]
Index: root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c
===================================================================
--- root.orig/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c 2007-05-31 16:46:22.000000000 +0530
+++ root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c 2007-05-31 16:53:02.000000000 +0530
@@ -956,13 +956,18 @@
goto fork_out;
retval = -EAGAIN;
-
+
+ /*
+ * Following code does not allow Non Root User to cross its process
+ * limit and it prevents Fork Bombing Attack.
+ */
if (atomic_read(&p->user->processes) >=
p->signal->rlim[RLIMIT_NPROC].rlim_cur) {
if (!capable(CAP_SYS_ADMIN) && !capable(CAP_SYS_RESOURCE) &&
- p->user != &root_user)
+ p->user != &root_user) {
+ printk(KERN_CRIT"User with uid %d is crossing its Process limit\n",p->user->uid);
goto bad_fork_free;
-
+ }
}
atomic_inc(&p->user->__count);
next reply other threads:[~2007-05-31 13:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-31 13:45 Anand Jahagirdar [this message]
2007-05-31 13:46 ` Jens Axboe
2007-06-01 6:48 ` Anand Jahagirdar
2007-06-01 7:25 ` Daniel Hazelton
2007-06-01 7:30 ` Jens Axboe
2007-06-01 8:00 ` Daniel Hazelton
2007-06-01 8:02 ` Jens Axboe
2007-06-03 23:01 ` Nix
2007-06-04 1:29 ` Daniel Hazelton
2007-06-04 14:49 ` Anand Jahagirdar
2007-06-04 14:58 ` Jiri Kosina
2007-06-04 15:28 ` Daniel Hazelton
2007-06-05 14:20 ` Anand Jahagirdar
2007-06-01 8:38 ` Jiri Kosina
2007-06-01 14:29 ` Anand Jahagirdar
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=25ae38200705310645n5e913a91weaa14521908f7989@mail.gmail.com \
--to=anandjigar@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=security@kernel.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®