public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Fork Bombing Patch
@ 2007-08-16  6:24 Anand Jahagirdar
  2007-08-16  7:40 ` Petr Tesarik
                   ` (2 more replies)
  0 siblings, 3 replies; 23+ messages in thread
From: Anand Jahagirdar @ 2007-08-16  6:24 UTC (permalink / raw)
  To: linux-kernel

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

Hello All
           I have searched for Maintainers List to get the correct
Maintainer for my patch. But i am not getting exact maintainer to
which i should forward my patch. Will any body please tell me,to which
maintainer i should forward my patch for its inclusion?

Summery of the Patch:

This patch Warns the administrator about the fork bombing attack
(whenever any user is crossing its process limit). I have used
printk_ratelimit function in this patch. This function helps to
prevent flooding of syslog and prints message as per the values set by
root user in following files:-

1) /proc/sys/kernel/printk_ratelimit:- This file contains value for,
how many times message should be printed in syslog.

2) /proc/sys/kernel/printk_ratelimit_burst: - This file contains value
for, after how much time message should be repeated.

This patch is really helpful for administrator/root user from security
point of view. They can take action against attacker by looking at
syslog messages related with fork bombing attack.

Added comments will definitely help developers.

Signed-Off-by: Anand Jahagirdar <anandjigar@gmail.com>

[-- Attachment #2: fork.patch~ --]
[-- Type: text/plain, Size: 1109 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-06-26 20:40:06.000000000 +0530
+++ root/Desktop/a1/linux-2.6.17.tar.bz2_FILES/linux-2.6.17/kernel/fork.c	2007-06-26 20:41:41.000000000 +0530
@@ -957,12 +957,19 @@
 
 	retval = -EAGAIN;
 	
-        
+        /*
+         * following code does not allow Non Root User to cross its process
+         * limit and it alerts administrator about user Nearing the process limit.
+         */
+ 
       	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)  {
+                        if (printk_ratelimit())
+                                printk(KERN_WARNING "User with uid %u is Nearing the process limit\n",p->user->uid);
+
 			 goto bad_fork_free;
-			
+		}			
 			
 	atomic_inc(&p->user->__count);
 	atomic_inc(&p->user->processes);

^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2008-06-18 14:07 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-16  6:24 Fork Bombing Patch Anand Jahagirdar
2007-08-16  7:40 ` Petr Tesarik
2007-08-17  7:19   ` Paul Jackson
2007-08-17  7:42     ` Petr Tesarik
2007-08-17  9:05       ` Paul Jackson
2007-08-16 11:19 ` Krzysztof Halasa
2007-08-16 11:27   ` Jan Engelhardt
2007-08-20 14:26   ` Anand Jahagirdar
2007-08-20 14:38     ` Jesper Juhl
2007-08-16 21:06 ` Chris Snook
2007-08-20 14:24   ` Anand Jahagirdar
2007-08-20 14:42     ` Chris Snook
2007-08-22  6:17       ` Anand Jahagirdar
2007-08-23 11:52         ` Krzysztof Halasa
2007-08-23 19:01           ` Chris Snook
2007-08-23 21:47             ` Krzysztof Halasa
     [not found]               ` <7b9198260708231737t33923ec6yde48bb1338a6fa70@mail.gmail.com>
2007-08-24  0:37                 ` Tom Spink
2007-08-29  9:48             ` Anand Jahagirdar
2007-08-29 11:29               ` Simon Arlott
2007-08-29 11:54                 ` Anand Jahagirdar
2007-08-29 13:49                   ` Chris Snook
2007-09-02  8:52                     ` Kyle Moffett
     [not found]                     ` <25ae38200806180502i4d78e240l210b261f05f10507@mail.gmail.com>
     [not found]                       ` <25ae38200806180505m61d51440ma5754fa817dfbc0b@mail.gmail.com>
2008-06-18 13:39                         ` Chris Snook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox