* [PATCH] Linux kernels DoSable by file-max limit
@ 2002-07-11 17:11 elv
0 siblings, 0 replies; only message in thread
From: elv @ 2002-07-11 17:11 UTC (permalink / raw)
To: linux-kernel
hi,
in the previous patch a line was missed
--- ../patches/linux/fs/file_table.c Mon Sep 17 20:16:30 2001
+++ fs/file_table.c Thu Jul 11 19:01:40 2002
@@ -51,9 +51,13 @@
return f;
}
/*
- * Use a reserved one if we're the superuser
+ * Use one of the first 16 reserved fds if we have euid == 0
+ * and one of the second 16 reserved fds if we're the superuser
*/
- if (files_stat.nr_free_files && !current->euid)
+ if (files_stat.nr_free_files > NR_RESERVED_FILES/2 && !current->euid)
+ goto used_one;
+ else if (files_stat.nr_free_files <= NR_RESERVED_FILES/2 && !current->uid
+ && files_stat.nr_free_files != 0)
goto used_one;
/*
* Allocate a new one if we're below the limit.
--- /usr/src/linux/include/linux/fs.h Mon Jul 1 14:48:44 2002
+++ /usr/src/linux/include/linux/fs.h Tue Jul 9 00:07:06 2002
@@ -65,7 +65,7 @@
extern int leases_enable, dir_notify_enable, lease_break_time;
#define NR_FILE 8192 /* this can well be larger on a larger system */
-#define NR_RESERVED_FILES 10 /* reserved for root */
+#define NR_RESERVED_FILES 32 /* first 16 for euid == 0 processes and second
16 only for root */
#define NR_SUPER 256
#define MAY_EXEC 1
elv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2002-07-11 17:09 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-07-11 17:11 [PATCH] Linux kernels DoSable by file-max limit elv
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®