lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 21 May 2008 17:34:41 +0800
From:	Li Yang <leoli@...escale.com>
To:	linux-mm@...ck.org
Cc:	linux-kernel@...r.kernel.org, Kong Wei <weikong@...flag-linux.com>
Subject: [PATCH] [mm] limit the min_free_kbytes

From: Kong Wei <weikong@...flag-linux.com>

Unlimited of min_free_kbytes is dangerous,
An user of our company set this value bigger than 3584*1024*K,
cause the system OOM on DMA.
And I try a even more bigger number will cause the system hang immediately.
Limited as 64M may not a good value, but as default in init_per_zone_pages_min.
And this option may not need again?

Signed-off-by: Kong Wei <weikong@...flag-linux.com>
---
 kernel/sysctl.c |    5 ++++-
 mm/page_alloc.c |    2 +-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 8b7e954..d052522 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -103,6 +103,8 @@ static int minolduid;
 static int min_percpu_pagelist_fract = 8;
 
 static int ngroups_max = NGROUPS_MAX;
+static int min_min_free_kbytes = 128;
+static int max_min_free_kbytes = 65536;
 
 #ifdef CONFIG_KMOD
 extern char modprobe_path[];
@@ -1010,7 +1012,8 @@ static struct ctl_table vm_table[] = {
 		.mode		= 0644,
 		.proc_handler	= &min_free_kbytes_sysctl_handler,
 		.strategy	= &sysctl_intvec,
-		.extra1		= &zero,
+		.extra1		= &min_min_free_kbytes,
+		.extra2		= &max_min_free_kbytes,
 	},
 	{
 		.ctl_name	= VM_PERCPU_PAGELIST_FRACTION,
diff --git a/mm/page_alloc.c b/mm/page_alloc.c
index 75b9793..52979e9 100644
--- a/mm/page_alloc.c
+++ b/mm/page_alloc.c
@@ -4179,7 +4179,7 @@ module_init(init_per_zone_pages_min)
 int min_free_kbytes_sysctl_handler(ctl_table *table, int write, 
 	struct file *file, void __user *buffer, size_t *length, loff_t *ppos)
 {
-	proc_dointvec(table, write, file, buffer, length, ppos);
+	proc_dointvec_minmax(table, write, file, buffer, length, ppos);
 	if (write)
 		setup_per_zone_pages_min();
 	return 0;
-- 
1.5.0.3

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ