lkml.org 
[lkml]   [2003]   [Aug]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 2.6.0-test2] security fixes
From
Date
Andrew,
Here's a patch against 2.6.0-test2 security :
Summary:
-Adding some doc to enough_memory proc
-Reordering checks (overcommit_memory is _rare_ case)

Could you apply ?

Regards,
Fabian

diff -Naur orig/security/capability.c edited/security/capability.c
--- orig/security/capability.c 2003-07-27 17:00:30.000000000 +0000
+++ edited/security/capability.c 2003-08-16 10:31:33.000000000 +0000
@@ -295,12 +295,7 @@

vm_acct_memory(pages);

- /*
- * Sometimes we want to use more memory than we have
- */
- if (sysctl_overcommit_memory == 1)
- return 0;
-
+ /* We estimate memory ourselves (major cases)*/
if (sysctl_overcommit_memory == 0) {
free = get_page_cache_size();
free += nr_free_pages();
@@ -322,10 +317,16 @@

if (free > pages)
return 0;
+
vm_unacct_memory(pages);
return -ENOMEM;
}

+ /* Kernel assumes allocation */
+ if (sysctl_overcommit_memory == 1)
+ return 0;
+
+ /* sysctl_overcommit_memory must be 2 which means strict_overcommit*/
allowed = totalram_pages * sysctl_overcommit_ratio / 100;
allowed += total_swap_pages;


___________________________________


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.028 / U:0.112 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site