[merged] mm-prevent-setting-of-a-value-less-than-0-to-min_free_kbytes.patch removed from -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Subject: [merged] mm-prevent-setting-of-a-value-less-than-0-to-min_free_kbytes.patch removed from -mm tree
To: hanpt@xxxxxxxxxxxxxxxxxx,mhocko@xxxxxxx,rientjes@xxxxxxxxxx,mm-commits@xxxxxxxxxxxxxxx
From: akpm@xxxxxxxxxxxxxxxxxxxx
Date: Fri, 24 Jan 2014 10:59:07 -0800


The patch titled
     Subject: mm: prevent setting of a value less than 0 to min_free_kbytes
has been removed from the -mm tree.  Its filename was
     mm-prevent-setting-of-a-value-less-than-0-to-min_free_kbytes.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
Subject: mm: prevent setting of a value less than 0 to min_free_kbytes

If echo -1 > /proc/vm/sys/min_free_kbytes, the system will hang.  Changing
proc_dointvec() to proc_dointvec_minmax() in the
min_free_kbytes_sysctl_handler() can prevent this to happen.

mhocko said:

: You can still do echo $BIG_VALUE > /proc/vm/sys/min_free_kbytes and make
: your machine unusable but I agree that proc_dointvec_minmax is more
: suitable here as we already have:
: 
: 	.proc_handler   = min_free_kbytes_sysctl_handler,
: 	.extra1         = &zero,
: 
: It used to work properly but then 6fce56ec91b5 ("sysctl: Remove references
: to ctl_name and strategy from the generic sysctl table") has removed
: sysctl_intvec strategy and so extra1 is ignored.

Signed-off-by: Han Pingtian <hanpt@xxxxxxxxxxxxxxxxxx>
Acked-by: Michal Hocko <mhocko@xxxxxxx>
Acked-by: David Rientjes <rientjes@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/page_alloc.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff -puN mm/page_alloc.c~mm-prevent-setting-of-a-value-less-than-0-to-min_free_kbytes mm/page_alloc.c
--- a/mm/page_alloc.c~mm-prevent-setting-of-a-value-less-than-0-to-min_free_kbytes
+++ a/mm/page_alloc.c
@@ -5754,7 +5754,12 @@ module_init(init_per_zone_wmark_min)
 int min_free_kbytes_sysctl_handler(ctl_table *table, int write,
 	void __user *buffer, size_t *length, loff_t *ppos)
 {
-	proc_dointvec(table, write, buffer, length, ppos);
+	int rc;
+
+	rc = proc_dointvec_minmax(table, write, buffer, length, ppos);
+	if (rc)
+		return rc;
+
 	if (write) {
 		user_min_free_kbytes = min_free_kbytes;
 		setup_per_zone_wmarks();
_

Patches currently in -mm which might be from hanpt@xxxxxxxxxxxxxxxxxx are

origin.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux