From: Michal Hocko Date: Thu, 13 Jan 2011 23:47:26 +0000 (-0800) Subject: hugetlb: check the return value of string conversion in sysctl handler X-Git-Tag: v2.6.38-rc1~91 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=08d4a24659f1284f33e574211435aa12ce968477;p=pandora-kernel.git hugetlb: check the return value of string conversion in sysctl handler proc_doulongvec_minmax may fail if the given buffer doesn't represent a valid number. If we provide something invalid we will initialize the resulting value (nr_overcommit_huge_pages in this case) to a random value from the stack. The issue was introduced by a3d0c6aa when the default handler has been replaced by the helper function where we do not check the return value. Reproducer: echo "" > /proc/sys/vm/nr_overcommit_hugepages [akpm@linux-foundation.org: correctly propagate proc_doulongvec_minmax return code] Signed-off-by: Michal Hocko Cc: CAI Qian Cc: Nishanth Aravamudan Cc: Andrea Arcangeli Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed